Advertisement
deyanmalinov

09. Spice Must Flow

Feb 13th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. package DPM;
  2. import java.util.*;
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.         int spice = scan.nextInt();
  7.         int days=0;
  8.         int tatalSpice = 0;
  9.         while (spice>=100){
  10.             days++;
  11.             tatalSpice += (spice-26);
  12.             spice -=10;
  13.         }
  14.         if (tatalSpice>=26){
  15.             tatalSpice -=26;
  16.         }
  17.         System.out.println(days);
  18.         System.out.println(tatalSpice);
  19.  
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement