C语言判断一个数是不是质数#include#include#includeint main(){int i,a;double gh1;int gh2;scanf("%d",&i);gh1=sqrt(i);gh2=gh1;if(i

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/30 14:21:09
C语言判断一个数是不是质数#include#include#includeint main(){int i,a;double gh1;int gh2;scanf(
x͐J@_e( 5ܤͥ1t".*bVئ Xdy '-w'e6-'=icV}z*vC/gx!P4u[αRYNGV¶

C语言判断一个数是不是质数#include#include#includeint main(){int i,a;double gh1;int gh2;scanf("%d",&i);gh1=sqrt(i);gh2=gh1;if(i
C语言判断一个数是不是质数
#include
#include
#include
int main()
{
int i,a;
double gh1;
int gh2;
scanf("%d",&i);
gh1=sqrt(i);
gh2=gh1;
if(i

C语言判断一个数是不是质数#include#include#includeint main(){int i,a;double gh1;int gh2;scanf("%d",&i);gh1=sqrt(i);gh2=gh1;if(i
else if(a=i)
应该改成
for(a=2;a=gh2) {printf("%d是质数\n",i); goto loop;}
}
因为当i>2时sqrt(i)肯定比i小,你原来的else if(a==i)肯定判断不符合