monkeyslut45

Кирилл Деменев

Oct 28th, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         int num; String type;
  7.  
  8.         Scanner in = new Scanner(System.in);
  9.  
  10.         num = in.nextInt();
  11.         type = in.next();
  12.  
  13.         if (type.equals("байт")) {
  14.             System.out.println(num * 1024);
  15.         }
  16.         else if (type.equals("килобайт")) {
  17.             System.out.println(num / 1024);
  18.         }
  19.         else {
  20.             System.out.println("Пожалуйста, введите корректно условие");
  21.         }
  22.     }
  23. }
Add Comment
Please, Sign In to add comment