You are viewing a single comment's thread. Return to all comments →
int n = in.nextInt(); int k = n/3; if(n == 1){ System.out.println(1); } else if(n%3 == 0){ System.out.println(k*k*k); } else if(n%3 == 1){ System.out.println((k+1)*k*k); } else if(n%3 == 2){ System.out.println((k+1)*(k+1)*k); }
Seems like cookies are disabled on this browser, please enable them to open this website
Ann and Jimmy
You are viewing a single comment's thread. Return to all comments →