Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <string>
  2. #include <iostream>
  3. #include <list>
  4. #include <algorithm>
  5. using namespace std;
  6. int main(){
  7. int n,i,j,k,rb,kp,s=0;
  8. cin>>rb>>kp;
  9. while(rb>=5){rb-=5;s++;}
  10. while(rb>=2){rb-=2;s++;}
  11. while(rb>=1){rb-=1;s++;}
  12. while(kp>=50){kp-=50;s++;}
  13. while(kp>=10){kp-=10;s++;}
  14. while(kp>=5){kp-=5;s++;}
  15. while(kp>=1){kp-=1;s++;}
  16. cout<<s;
  17. return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement