Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- System.out.println("Как вам выдать крупными или мелкими?");
- Scanner scanner = new Scanner(System.in);
- int value = scanner.nextInt();
- } else {
- System.out.println("Крупными");
- int moneyValue = 7850;
- int[] noteValues = {5000, 2000, 1000, 500, 200, 100, 50, 10};
- if (moneyValue > 15000) {
- System.out.println("ATM Cash Limit exceeds.");
- } else {
- for (int i = 0; i < noteValues.length && moneyValue != 0; i++) {
- if (moneyValue >= noteValues[i])
- System.out.println("No of " + noteValues[i] + "'s" + " :" + moneyValue / noteValues[i]);
- moneyValue = moneyValue % noteValues[i];
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement