Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- System.out.println("Введите число километров, которое преодолевает бегун: ");
- double x = sc.nextInt();
- System.out.println("Введите число километров, которое надо преодолеть: ");
- double y = sc.nextInt();
- int day = 0;
- while (x < y) {
- x += x / 100 * 10;
- day++;
- }
- System.out.printf("Вам понадобится %d дней.", day);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment