grach

Club - exam 6-7 July 2017

Apr 13th, 2020
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Club {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.  
  7.         int profit = Integer.parseInt(scan.nextLine());
  8.  
  9.         String coctail = scan.nextLine();
  10.         int price = coctail.length();
  11.         //System.out.println(price);
  12.  
  13.         while (!"Party".equals(coctail)) {
  14.             coctail= scan.nextLine(); // тук гърми 2-я текст
  15.             int orders = Integer.parseInt(coctail);
  16.             price = price + orders;
  17.  
  18.             if (price*1.0 % 2 != 0) {
  19.                 price *= 0.75;
  20.             }
  21.            // coctail = scan.nextLine(); // тук гърми 1-я текст
  22.         }
  23.         System.out.println(price);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment