import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int count=1; while(in.hasNext()){ int n =in.nextInt(); if(ifss(n)) { System.out.println("Case #"+(count++)+": "+"I'm richer than any one"); }else { System.out.println("Case #"+(count++)+": "+"What a fxcking day"); } } } public static boolean ifss(int n ) { //if(n==1) { // return false; //} for(int i =2;i<=Math.sqrt(n);i++) { if(n%i==0) { return false; } } return true; } } |
Double click to view unformatted code.