ง่าย 0 ข้อที่แก้แล้ว อัตราผ่าน 0%

Celsius to Fahrenheit

Convert a temperature from Celsius to Fahrenheit.

โจทย์

Convert a temperature in degrees Celsius to degrees Fahrenheit using F = C × 9 / 5 + 32.

Implement celsius_to_fahrenheit(celsius).

Input

celsius: The temperature in degrees Celsius.

Output

Return the temperature in degrees Fahrenheit (a decimal number).

เงื่อนไข

-273.15 ≤ celsius ≤ 10,000

ตัวอย่าง

ตัวอย่างที่ 1
อินพุต:
celsius = 100.0

ผลลัพธ์ที่คาดหวัง:
expected = 212.0
อินพุต:
double celsius = 100.0;

ผลลัพธ์ที่คาดหวัง:
double expected = 212.0;
อินพุต:
double celsius = 100.0;

ผลลัพธ์ที่คาดหวัง:
double expected = 212.0;

คำอธิบาย

100 × 9 / 5 + 32 = 212, the boiling point of water.

ตัวอย่างที่ 2
อินพุต:
celsius = -40.0

ผลลัพธ์ที่คาดหวัง:
expected = -40.0
อินพุต:
double celsius = -40.0;

ผลลัพธ์ที่คาดหวัง:
double expected = -40.0;
อินพุต:
double celsius = -40.0;

ผลลัพธ์ที่คาดหวัง:
double expected = -40.0;

คำอธิบาย

-40 × 9 / 5 + 32 = -40: both scales meet at -40.

แหล่งอ้างอิง

โจทย์นี้ปรับให้เหมาะกับ CodeUtility กรุณาทำตามคำชี้แจงและข้อจำกัดด้านบน

เรียนรู้จากคนอื่น

แนวทางจากชุมชน

ยังไม่มีวิธีทำที่เผยแพร่ ลองแก้โจทย์นี้เพื่อแชร์วิธีแรก