#include <stdio.h> #include <math.h> int main() { int cnt = 0; for (int i = 101; i <= 999; i += 2) { int flag = 1; for (int j = 2; j <= sqrt(i); j++) { if (i % j == 0) { flag = 0; break; } } if (flag == 1) cnt++; } printf("%d", cnt); return 0; }
#include <stdio.h> #include <math.h> int main() { int cnt = 0; for (int i = 101; i <= 999; i += 2) { int flag = 1; for (int j = 2; j <= sqrt(i); j++) { if (i % j == 0) { flag = 0; break; } } if (flag == 1) cnt++; } printf("%d", cnt); return 0; }