Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x;
- cin>>x;
- int nrpc=0,nrpg=0,nrpct=0;
- while(nrpct!=x)
- {
- if(nrpct<x)
- {
- nrpct+=5;
- nrpc+=1;
- }
- else
- {
- nrpct-=3;
- nrpg+=1;
- }
- }
- cout<<nrpc<<" "<<nrpg;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement