Solution
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
class Solution {
public static double[] convertTemperature(double celsius) {
double[] answer = new double[2];
answer[0] = celsius + 273.15; // Kelvin
answer[1] = celsius * 1.80 + 32.00; // Fahrenheit
return answer;
}
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
double celsius = Double.parseDouble(br.readLine());
System.out.print(Arrays.toString(convertTemperature(celsius)));
br.close();
}
}
Leave a comment