fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int n, count = 0;
  6.  
  7. if (scanf("%d", &n) != 1 || n < 1) {
  8. printf("Input error");
  9. return 0;
  10. }
  11.  
  12. for(int i = 1; i <= n; i++) {
  13. if (n % i == 0) {
  14. count++;
  15. }
  16. }
  17.  
  18. if (count == 2) {
  19. printf("yes");
  20. } else {
  21. printf("no");
  22. }
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0s 5312KB
stdin
7
stdout
yes