超级新手求教!赶鸡不尽!
c++吧
全部回复
仅看楼主
level 1
#include<iostream>
using namespace std;
void main()
{
double a;
cout<<"input a number"<<endl;
cin>>a;
cout<<"you inputed :"<<a<<endl;
system("pause");
}
当a的输入在 double 合法值内时,程序正常实现功能。那么怎么修改能对a作出一个判定,当它不合法时给出提示illegal value?
2013年10月03日 02点10分 1
level 11
cout<<"不要乱输,不然我会生气";[吐舌]
——Manjusaka.ylipl.七爷、
2013年10月03日 03点10分 2
level 14
if else?
2013年10月03日 03点10分 3
level 8
if(cin>>a)cout<<"" ;
else
cout<<"数据非法";
2013年10月03日 03点10分 4
1