标签:style class code += using span max c++ 质数
#include <iostream> #include <cmath> // for sqrt() using namespace std; #define MAX 100 //质数 int main() { cout << "2"; int i; int j; for (i = 3; i < MAX + 1; i += 2) { for ( j = 3; j <= sqrt(i); j += 2) { if (i % j == 0) { break; } } if (j > sqrt(i)) { cout << i << ‘ ‘; } } cout << endl; system("pause"); return 0; }
标签:style class code += using span max c++ 质数
原文地址:https://www.cnblogs.com/jingchu/p/10053656.html