package com.javarush.task.task15.task1519;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
Разные методы для разных типов
*/
public class Solution {
public static void main(String[] args) throws IOException {
//напиште тут ваш код
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while(true) {
String string = reader.readLine();
if(string.equals("exit")) break;
try {
double d = Double.parseDouble(string);
short s = Short.parseShort(string);
int n = Integer.parseInt(string);
if(string.contains(".")) {
print(d);
}else if(s > 0 && s < 128){
print(s);
}else if(n <= 0 || n >= 128) {
print(n);
}else {
print(string);
}
} catch(NumberFormatException e) {
print(string);
}
}}
public static void print(Double value) {
System.out.println("Это тип Double, значение " + value);
}
public static void print(String value) {
System.out.println("Это тип String, значение " + value);
}
public static void print(short value) {
System.out.println("Это тип short, значение " + value);
}
public static void print(Integer value) {
System.out.println("Это тип Integer, значение " + value);
}
}