Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SpiceMustFlow {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int startingYield = Integer.parseInt(scanner.nextLine());
- int workersSpice = 26;
- int days = 0;
- int sumSpice = 0;
- if (startingYield >= 100) {
- while (startingYield >= 100) {
- sumSpice += startingYield - workersSpice;
- startingYield -= 10;
- days++;
- }
- sumSpice -= 26;
- }
- System.out.println(days);
- System.out.println(sumSpice);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment