Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int a,b,x;
  4. int main()
  5. {
  6. cin>>a>>b;
  7. if (a>b)
  8. x=a-b;
  9. else if (a<b)
  10. x=b-a;
  11. else x=0;
  12. if (a>b) cout<<"Primul copil este mai mare cu "<<x<<" ani";
  13. else if (a<b) cout<<"Al doilea copil este mai mare cu "<<x<<" ani";
  14. else cout<<"Copiii au varste egale";
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement