标题:新手求哪错了
取消只看楼主
yangguangyao
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2012-12-3
结帖率:100%
已结贴  问题点数:20 回复次数:0 
新手求哪错了
#include<iostream>
using namespace std;
int money(int i){
    int a,b,c;
    c=0;
    for(b=1;b<=a;b++){
                      while(a%b==0)
                      c++;
                      if(c==2)
                      return a;
                      else
                      break;
                      }
                      }
int main(){
        int i;
        cout<<"请输入一个数";
        cin>>i;
        if(money(i))
        cout<<"是质数";
        system("pause");
        return 0;
        }
搜索更多相关主题的帖子: system include return 
2012-12-07 11:49



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




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

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