Advertisement
STANAANDREY

_1

Dec 2nd, 2018
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main()
  6. {
  7.     int x;
  8.  cin>>x;
  9. int nrpc=0,nrpg=0,nrpct=0;
  10. while(nrpct!=x)
  11. {
  12. if(nrpct<x)
  13. {
  14. nrpct+=5;
  15. nrpc+=1;
  16. }
  17. else
  18. {
  19. nrpct-=3;
  20. nrpg+=1;
  21. }
  22. }
  23. cout<<nrpc<<" "<<nrpg;
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement