MASchmidt icon

potenzmenge

MASchmidt | PRO | 02/03/18 04:40:13 PM UTC | 0 ⭐ | 202 👁️ | Never ⏰ | []
Java |

370 B

|

None

|

0 👍

/

0 👎

 
public class potenzmenge {
 
    public static void main(String[] args) {
        int x, y, z, treffer = 0;
        int max = 8;
        max++;
        
        for(int i=0; i<max; i++) {
            x = i;
            for(int j=0; j<max; j++) {
                y = j;
                for(int k=0; k<max; k++) {
                    z = k;
                    if((x+y+z)%3==0) {
                        treffer++;
                    }
                }
                
            }
        }
        System.out.print(treffer);
    }
 
}

Comments