0$房天下问答|c语言程序题$https://m.fang.com/ask/ask_564482.html$https://static.soufunimg.com/common_m/m_public/201511/images/asksharedefault.png
packc/pages/ask/detail/detail?askid=564482
-
c语言程序题
输入两个整数m,n 输出其间的所有素数。大家看看我这个程序,指导一下。#include <stdio.h>#include<math.h>void main() { int m,n,i,count,k; double j; printf("Input m:"); scanf("%d",&m); printf("Input n:"); scanf("%d",&n); count=0; for(k>=m&&k<=n;k++;){ j=sqrt(k); for(i>=m&&i<=j;i++;) if(k%i==0) break; if(i>m){ printf("%d",k); count++; if(count%6==0) printf("\n"); } } printf("\n");}
更多
免责声明:问答内容均来源于互联网用户,房天下对其内容不负责任,如有版权或其他问题可以联系房天下进行删除。

关注成功