想吃冰卻又敏感保護不足?直擊★美車模手癢不小心...攝影界美人正妹指定相機款24天後重啟院會 兩岸...
2011-12-03 17:36:16 人氣(582) | 回應(0) | 推薦(0) | 收藏(0) 上一篇 | 下一篇

[UVA] 11984 - A Change in Thermal Unit

0
收藏
0
推薦

H

A Change in Thermal Unit

Measuring temperature and temperature differences are common task in many research and applications. Unfortunately, there exists more than one unit of measuring temperatures. This introduces a lot of confusion at times. Two popular units of measurements are Celsius(C) and Fahrenheit (F). The conversion of F from C is given by the formula:

In this problem, you will be given an initial temperature in C and an increase in temperature in F. You would have to calculate the new temperature in C.

Input

Input starts with an integer T (≤ 100), denoting the number of test cases.

Each case contains a line with two integers C and d (0 ≤ C, d ≤ 100), where C represents the initial temperature in Celsius and d represents the increase in temperature in Fahrenheit.

Output

For each case, print the case number and the new temperature in Celsius after rounding it to two digits after the decimal point.

Sample Input

Output for Sample Input

2

100 0

0 100

Case 1: 100.00

Case 2: 55.56





#include<stdio.h>

int main() {
    int T, test = 0, C, d;
    scanf("%d", &T);
    while(T--) {
        scanf("%d %d", &C, &d);
        printf("Case %d: %.2lf\n", ++test, (double)C+d*5/9.0);
    }
    return 0;
}

11984A Change in Thermal Unit
台長:Morris
人氣(582) | 回應(0)| 推薦 (0)| 收藏 (0)| 轉寄
全站分類: 不分類 | 個人分類: UVA |
此分類下一篇:[UVA] 12289 - One-Two-Three
此分類上一篇:[UVA] 1174 - IP-TV

我要回應
是 (若未登入"個人新聞台帳號"則看不到回覆唷!)
* 請輸入識別碼:
請輸入以下數字 (ex:123)

(有*為必填)
詳全文