fork download
  1. //5-58.
  2. #include <stdio.h>
  3. int main()
  4. {
  5. int cnt=0;
  6. for(int i=2;i<=100;){
  7. for(int j=2;j<=i/2;j++)
  8. if(i%j==0)
  9. goto label;
  10. printf("%d, ",i);
  11. cnt++;
  12. label:
  13. i++;
  14. }
  15. printf("\n %d개",cnt);
  16. }
Success #stdin #stdout 0s 4300KB
stdin
Standard input is empty
stdout
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 
 25개