Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment