Advertisement
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 scan = new Scanner(System.in);
- int startingYield = Integer.parseInt(scan.nextLine());
- int dayCnt = 0;
- int sumOfSpice = 0;
- while (startingYield >= 100) {
- dayCnt++;
- sumOfSpice += startingYield;
- sumOfSpice -= 26;
- startingYield -= 10;
- if (startingYield < 100){
- sumOfSpice -= 26;
- }
- }
- System.out.println(String.format("%d%n%d", dayCnt, sumOfSpice));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement