| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
共有 275 人关注过本帖
标题:新手,帮忙找下错!!!
取消只看楼主 加入收藏
其实、不想说
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:122
专家分:156
注 册:2011-3-3
结帖率:92.31%
收藏
已结贴  问题点数:10 回复次数:2 
新手,帮忙找下错!!!
#include "stdio.h"
#include "stdlib.h"
#include "time.h"
#include "math.h"
int f1(int x);
main()
{int x,i;

 stand(time(NULL));
 for(i=1;i<=50;i++)
 {x=rand()%201+300;
  if(f1(x))
  {printf("%7d*",x);
  }
  else{printf("%d",x);
      }
}
int f1(int x)
{int a=2;

 for(a=2;a<=(int)sqrt(x);a++)
 {if(x%a==0)
  {return 0;
  }
 }
 return 1;
}

2011-04-02 23:01
其实、不想说
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:122
专家分:156
注 册:2011-3-3
收藏
得分:0 
还是运行不了,  
2011-04-02 23:14
其实、不想说
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:122
专家分:156
注 册:2011-3-3
收藏
得分:0 
谢了,找到错了!!!
2011-04-02 23:37
快速回复:新手,帮忙找下错!!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025219 second(s), 8 queries.
Copyright©2004-2025, BC-CN.NET, All Rights Reserved