Advertisement
Josif_tepe

Untitled

May 7th, 2022
746
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None
  1. import java.util.Scanner;
  2.  
  3. public class MAin {
  4.     public static void main(String[] args) {
  5.         Scanner sc = new Scanner(System.in);
  6.         int n = sc.nextInt();
  7.         int paricki = 0;
  8.        paricki +=  (n / 50);
  9.        n = n - (50 * (n / 50));
  10.        paricki += (n / 10);
  11.        n = n - (10 * (n / 10));
  12.     paricki += (n / 5);
  13.     n = n - (5 * (n / 5));
  14.     paricki += (n / 2);
  15.     n = n - (2 * (n / 2));
  16.     paricki += n;
  17.         System.out.println(paricki);
  18.     }
  19. }
  20. // 158
Advertisement
RAW Paste Data Copied
Advertisement