#include <stdio.h>
main ( ) {
   int i,j,check ;
   printf("2");
   for(i = 3; i < 1000000; i+=2){
     (check = 0);
       for(j = 3; j*j < i; j++){
         if(i % j ==0 ) {
          (check = 1);
}
         }
      }
      if(check == 0){
       printf("%d\n",i);
 }
printf("\n");
}
出来ちゃったみたい。
これでだめならあきらめますね。
心中・・・