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