Advertisement
Guest User

9.*Spice Must Flow

a guest
May 27th, 2019
903
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. package com.company.DataTypesVariables.Exercise;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Upr9 {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         int startingYield=Integer.parseInt(scanner.nextLine());
  10.         int amount=0;
  11.         int days=0;
  12.  
  13.         while (startingYield>0){
  14.             if (startingYield<100){
  15.                 if (amount<26){
  16.                     break;
  17.                 }
  18.                 amount-=26;
  19.                 break;
  20.             }
  21.             amount+=startingYield-26;
  22.             startingYield-=10;
  23.  
  24.             days++;
  25.         }
  26.         System.out.println(days);
  27.         System.out.println(amount);
  28.  
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement