33,311
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
using namespace std;
int jud(int a,int b)
{ if(a>=0&&a<=10&&b>=0&&b<=10)return 1;
else return 0;
}
int main()
{
int a,b;
cout<<"Two integer a,,b (0 ≤ a,b ≤ 10)"<<endl;
cin >> a >> b;
while(!jud(a,b)){
cout<<"error input"<<endl;
cin>>a>>b;
}
cout << a+b << endl;
return 0;
}