ToniDev

Sub Bac - Ex 3 - Cat si Rest

May 24th, 2022
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct impartire{
  5.     int cat;
  6.     int rest;
  7. }rezultat;
  8.  
  9. int main()
  10. {
  11.  
  12.     int x;
  13.  
  14.     cout << "x = "; cin >> x;
  15.    
  16.     rezultat.cat = 2018 / x;
  17.     rezultat.rest = 2018 % x;
  18.    
  19.     cout << "Cat: " << rezultat.cat;
  20.     cout << endl << "Rest: " << rezultat.rest;
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment