0

about mathematical operation

I have already checked it once and once again,but I still don't know why can't it run normally Hope to get your help thanks a lot :) ------from a Chinese starter https://code.sololearn.com/cYnBL3kAl3p4/?ref=app

10th May 2018, 11:47 AM
HZCK_Mi Sa Pon
HZCK_Mi Sa Pon - avatar
2 odpowiedzi
0
Replace cin>> a,b; with cin >> a; cin >> b; Also try and improve your formatting, it took me awhile to understand what was wrong. #include <iostream> using namespace std; int main() { int a,b,c; cout<<"type in two numbers and let the second one bigger \n"; cin >> a; cin >> b; if (b > a) { cout << "you're right\n"; } if (a > b) { cout <<"!!!you're wrong!!! \n"; } c=a-b; cout <<"b is "<< c <<" smaller than a"; return 0; }
10th May 2018, 12:11 PM
apex137
apex137 - avatar
0
get it :) thanks a lot
10th May 2018, 3:43 PM
HZCK_Mi Sa Pon
HZCK_Mi Sa Pon - avatar