Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class goDev {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int shir = Integer.parseInt(sc.nextLine());
- int dal = Integer.parseInt(sc.nextLine());
- int vis = Integer.parseInt(sc.nextLine());
- int staq = shir * dal * vis;
- String isDone = "";
- while (!isDone.equals("Done")) {
- isDone = sc.nextLine();
- if (isDone.equals("Done")){
- break;
- }
- int kashon = Integer.parseInt(isDone);
- staq -= kashon;
- if (staq <= 0) {
- break;
- }
- } if (isDone.equals("Done")) {
- System.out.printf("%d Cubic meters left.", Math.abs(staq));
- } else {
- System.out.printf("No more free space! You need %d Cubic meters more.", Math.abs(staq));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement