Untitled
unknown
c_cpp
2 years ago
258 B
4
Indexable
#include <iostream>
#include <cmath>
using namespace std;
int IsPrime(int x) {
int count = 0;
for (int i = 2; i < x; i++) {
if (x % i == 0) {
count++;
}
}
return count;
}
int main()
{
int x;
cin >> x;
cout << IsPrime(x);
} Editor is loading...
Leave a Comment