Advertisement
kej

Untitled

kej
Mar 18th, 2022
638
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.90 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.         System.out.println("Как вам выдать крупными или мелкими?");
  9.         Scanner scanner = new Scanner(System.in);
  10.         int value = scanner.nextInt();
  11.     } else {
  12.         System.out.println("Крупными");
  13.  
  14.  
  15.         int moneyValue = 7850;
  16.         int[] noteValues = {5000, 2000, 1000, 500, 200, 100, 50, 10};
  17.         if (moneyValue > 15000) {
  18.             System.out.println("ATM Cash Limit exceeds.");
  19.         } else {
  20.             for (int i = 0; i < noteValues.length && moneyValue != 0; i++) {
  21.                 if (moneyValue >= noteValues[i])
  22.                     System.out.println("No of " + noteValues[i] + "'s" + " :" + moneyValue / noteValues[i]);
  23.                 moneyValue = moneyValue % noteValues[i];
  24.             }
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement