代码如下: #include <stdio.h> #include <iostream> #include <math.h> using namespace std; bool isprime(long a) { for (long i = 2; i <= sqrt(a); i++) { if (a%i == 0) return false; } return true; } int main() { long n; while (cin >> n) { long result; long times =...