C语言求助

[复制链接]
查看11 | 回复2 | 2009-12-3 16:58:01 | 显示全部楼层 |阅读模式
#include#include main(){ int a,b,i,x,court=0,prime=1; do {printf("please input a,b:\n");scanf("%d %d",&a,&b); for(x=a;x0); }这是我在你的基础上改的可以运行你自己好好看看注意括号的范围
回复

使用道具 举报

千问 | 2009-12-3 16:58:01 | 显示全部楼层
循环这里有问题,不好说明白,方法也不是很好~~ 素数这个问题一般都这么编,你借鉴一下看看#include "stdio.h"#include "math.h"int main(){
int j,k,i,m,n,count=0;
do {
printf("please input m,n:\n");
scanf("%d%d",&m,&n);
}while(m>=n||m=k+1){
printf("%4d ",j); if(++count%5==0)
printf("\n");}
}
return 0;}
回复

使用道具 举报

千问 | 2009-12-3 16:58:01 | 显示全部楼层
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行