Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. var n,i,kypuru,proverka,nom500,nom100,nom50,nom20,nom10,nom200: integer;
  2. begin
  3. read(n);
  4. proverka:=n mod 10;
  5. if proverka>0 then writeln(-1) else
  6. for i:=1 to n do begin
  7.  
  8. nom500:=n div 500;
  9. nom200:=(n-nom500*500) div 200;
  10. nom100:=(n-nom500*500-nom200*200) div 100;
  11. nom50:=(n-nom500*500-nom200*200-nom100*100) div 50;
  12. nom20:=(n-nom500*500-nom200*200-nom100*100-nom50*50) div 20;
  13. nom10:=(n-nom500*500-nom200*200-nom100*100-nom50*50-nom20*20) div 10;
  14. end;
  15. kypuru:=nom500+nom200+nom100+nom50+nom20+nom10;
  16. writeln(kypuru);
  17. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement