View Code of Problem 119

#include<stdio.h>
int main()
{
     int  n;
     int  k=1;

    while(scanf("%d",&n)!=EOF){
        if(n==1){
            printf("Case #%d: I'm richer than any one\n",k);
        }
        else{
                int flag=1;
                for(int i=2;i*i<=n;i++){
                if(n%i==0){
                    flag=0;
                    break;
                }
            }

        if(flag==0){
                printf("Case #%d: What a fxcking day\n",k);
            
        }
        else
         printf("Case #%d: I'm richer than any one\n",k);

        
            
    }
    k++;
}
return 0;
}

Double click to view unformatted code.


Back to problem 119