From 5abd338d577b9ba9f228fc698297c5e021e1190a Mon Sep 17 00:00:00 2001 From: haoxuan Date: Sat, 21 Mar 2026 05:45:07 -0400 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=E3=80=8C0228=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 100以内的质数 --- 0228/242.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 0228/242.cpp diff --git a/0228/242.cpp b/0228/242.cpp new file mode 100644 index 0000000..8620eda --- /dev/null +++ b/0228/242.cpp @@ -0,0 +1,23 @@ +#include +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<