#include"stdio.h"
#include"math.h"
main()
{
int m,n,k;
scanf("%d",&m);
n=sqrt(m);
for(k=2;k<=n;k++)
if(m%k==0)break;
if(k>n)
printf("%d yes\n",m);
else
printf("%d no\n",m);
}
此程序中,n=sqrt(m);的作用何在?if(m%k==0)break;
if(k>n)
printf("%d yes\n",m);的意思是什么
#include"stdio.h"
#include"math.h"
main()
{
int m,n,k;
scanf("%d",&m);
n=sqrt(m);
for(k=2;k<=n;k++)
if(m%k==0)break;
if(k>n)
printf("%d yes\n",m);
else
printf("%d no\n",m);
}
此程序中,n=sqrt(m);的作用何在?if(m%k==0)break;
if(k>n)
printf("%d yes\n",m);的意思是什么