Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Rakiya {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int day = 0;
- double sugar = 100;
- double alcohol = 0;
- double alcWithoutVinegard = 0;
- double temp2;
- do {
- alcohol = sugar / 10;
- sugar = sugar - alcohol;
- alcWithoutVinegard += alcohol - alcohol / 100;
- day++;
- }
- while (alcWithoutVinegard <= sugar);
- System.out.printf("The largest amount of alcohol will be harvested at %d day", day);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement