Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class MAin {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int n = sc.nextInt();
- int paricki = 0;
- while(n > 0) {
- if(n >= 50) {
- n -= 50;
- paricki++;
- }
- else if(n >= 10) {
- n -= 10;
- paricki++;
- }
- else if(n >= 5) {
- n -= 5;
- paricki++;
- }
- else if(n >= 2) {
- n -= 2;
- paricki++;
- }
- else {
- n -= 1;
- paricki++;
- }
- }
- System.out.println(paricki);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement