标题:新手,帮忙找下错!!!
取消只看楼主
其实、不想说
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;
}

搜索更多相关主题的帖子: include stand 
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



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-335519-1-1.html




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

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