Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Source code recreated from a .class file by IntelliJ IDEA
- // (powered by FernFlower decompiler)
- //
- import java.util.Scanner;
- public class Main {
- public Main() {
- }
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String[] products = new String[]{"Хлеб", "Яблоки", "Молоко"};
- int[] var10000 = new int[]{100, 200, 300};
- System.out.println("Список возможных товаров для покупки: ");
- int productNumber;
- for(productNumber = 0; productNumber < 3; ++productNumber) {
- System.out.print(productNumber + 1 + ". " + products[productNumber] + "\n");
- }
- productNumber = 0;
- int productCount = 0;
- System.out.println("\nВыберите товар и количество или введите `end`");
- String[] item;
- for(String input = scanner.nextLine(); input.equals("end"); productCount = Math.abs(Integer.parseInt(item[1]))) {
- System.out.println("\nВыберите товар и количество или введите `end`");
- input = scanner.nextLine();
- item = input.split(" ");
- productNumber = Integer.parseInt(item[0]) - 1;
- }
- System.out.println(productNumber);
- System.out.println(productCount);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment