Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- String n = sc.nextLine();
- int number = Integer.parseInt(n);
- double firstYear = (number + number / 20d) ;
- System.out.printf("%.2f%n",firstYear);
- double secondYear = firstYear + firstYear / 20d ;
- System.out.printf("%.2f%n" , secondYear );
- double thirdYear = secondYear + secondYear/ 20d ;
- System.out.printf("%.2f%n" , thirdYear);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement