C语言求找错误,
答案:1 悬赏:70 手机版
解决时间 2021-03-01 04:24
- 提问者网友:城市野鹿
- 2021-02-28 12:59
C语言求找错误,
最佳答案
- 五星知识达人网友:野慌
- 2021-02-28 14:28
# include
# include
int main()
{
int n, k, i,m=0;
for (n = 3; n <= 100; n = n + 1)
{
k = n - 1;
for (i = 2; i <= k; i++)
if (n%i == 0) break;
if (i >= k + 1)
{
printf("%d ", n);
m = m + 1;
if (m % 10 == 0) printf("
");//<-------------
}
//if (m % 10 == 0) printf("
");
}
printf("
");
return 0;
}
# include
int main()
{
int n, k, i,m=0;
for (n = 3; n <= 100; n = n + 1)
{
k = n - 1;
for (i = 2; i <= k; i++)
if (n%i == 0) break;
if (i >= k + 1)
{
printf("%d ", n);
m = m + 1;
if (m % 10 == 0) printf("
");//<-------------
}
//if (m % 10 == 0) printf("
");
}
printf("
");
return 0;
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯