【发布时间】:2015-11-01 01:20:01
【问题描述】:
我想制作一个程序,让用户输入由空格分隔的三位数字,我想显示最小的数字。
查看我的代码:
#include<iostream>
using namespace std;
int main( )
{
int a,b,c;
cout<<" enter three numbers separated by space... "<<endl;
cin>>a>>b>>c;
int result=1;
while(a && b && c){
result++;
a--; b--; c--;
}
cout<<" minimum number is "<<result<<endl;
system("pause");
return 0;
}
示例输入:
3 7 1
样本输出:
2
它不显示最小的数字。我的代码有什么问题,我该如何解决我的问题?
【问题讨论】:
-
你需要调试你的代码
标签: c++ visual-studio min