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) {
- int num; String type;
- Scanner in = new Scanner(System.in);
- num = in.nextInt();
- type = in.next();
- if (type.equals("байт")) {
- System.out.println(num * 1024);
- }
- else if (type.equals("килобайт")) {
- System.out.println(num / 1024);
- }
- else {
- System.out.println("Пожалуйста, введите корректно условие");
- }
- }
- }
Add Comment
Please, Sign In to add comment