NLKappa

Homework 01.10

Sep 30th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner sc = new Scanner(System.in);
  9.  
  10.         System.out.println("Введите число километров, которое преодолевает бегун: ");
  11.         double x = sc.nextInt();
  12.         System.out.println("Введите число километров, которое надо преодолеть: ");
  13.         double y = sc.nextInt();
  14.         int day = 0;
  15.         while (x < y) {
  16.             x += x / 100 * 10;
  17.             day++;
  18.         }
  19.         System.out.printf("Вам понадобится %d дней.", day);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment