Професионална програма
Loading...
+ Нов въпрос
MartinBG avatar MartinBG 3828 Точки
Best Answer
import java.util.Scanner;

public class SpiceMustFlow {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int yield = Integer.parseInt(scanner.nextLine());
        int storage = 0;
        int days = 0;

        while (yield >= 100) {
            storage += yield - 26;
            days++;
            yield -= 10;
        }
        
        if (storage >= 26) {
            storage -= 26;
        }

        System.out.println(days);
        System.out.println(storage);
    }
}

 

0
TugayKafa avatar TugayKafa 3 Точки

Благодаря!

1