上传文件至「0228」

100以内的质数
This commit is contained in:
2026-03-21 05:45:07 -04:00
parent fe91ecf665
commit 5abd338d57

23
0228/242.cpp Normal file
View File

@@ -0,0 +1,23 @@
#include<iostream>
using namespace std;
int main(){
for(int a=2;a<=100;a++){
bool x=true;
for(int i=2;i*i<=a;i++)
if(a%i==0){
x=false;
break;
}
if(x){
cout<<a<<" ";
}
}
cout<<endl;
return 0;
}