以下是引用御坂美琴在2010-12-27 18:36:36的发言:
#include<stdio.h>
#include<math.h>
int main()
{
int i,k,sum = 0,m;
i = 101;
while (i <= 200)
{
m=(int)sqrt(i);
k = 3;
while (k <= m)
{
if (i % k == 0) break;
k++;
}
if (k > m)
{
printf("%d\n",i);
sum=sum+i;
}
i += 2;
}
printf("%d\n",sum);
return 0;
}
以下是引用御坂美琴在2010-12-27 18:36:36的发言:
#include<stdio.h>
#include<math.h>
int main()
{
int i,k,sum = 0,m;
i = 101;
while (i <= 200)
{
m=(int)sqrt(i);
k = 3;
while (k <= m)
{
if (i % k == 0) break;
k++;
}
if (k > m)
{
printf("%d\n",i);
sum=sum+i;
}
i += 2;
}
printf("%d\n",sum);
return 0;
}
以下是引用御坂美琴在2010-12-27 18:36:36的发言:
#include<stdio.h>
#include<math.h>
int main()
{
int i,k,sum = 0,m;
i = 101;
while (i <= 200)
{
m=(int)sqrt(i);
k = 3;
while (k <= m)
{
if (i % k == 0) break;
k++;
}
if (k > m)
{
printf("%d\n",i);
sum=sum+i;
}
i += 2;
}
printf("%d\n",sum);
return 0;
}
以下是引用御坂美琴在2010-12-27 18:36:36的发言:
#include<stdio.h>
#include<math.h>
int main()
{
int i,k,sum = 0,m;
i = 101;
while (i <= 200)
{
m=(int)sqrt(i);
k = 3;
while (k <= m)
{
if (i % k == 0) break;
k++;
}
if (k > m)
{
printf("%d\n",i);
sum=sum+i;
}
i += 2;
}
printf("%d\n",sum);
return 0;
}