标签:blog io ar for div log amp as tt
#include<stdio.h> #include<math.h> int main() { int n,i; while(scanf("%d",&n)!=EOF) { int flag=1; for(i=2;i<=sqrt(n)&&flag;i++) { if(n%i!=0) { flag=1; } else flag=0; } if(flag==0||n==1) { printf("不是素数\n"); } else { printf("是素数\n"); } } }
标签:blog io ar for div log amp as tt
原文地址:http://www.cnblogs.com/wuyuewoniu/p/4051246.html