有些內容使用中英雙語,有些只有英文或中文。歡迎使用與分享任何內容,但先來信告知並標示此部落格為出處。
Some parts use both Chinese and English, but some parts use only one language. Feel free to share, but please contact me first and list this blog as your reference.

2014年3月10日 星期一

UVa OJ - 11984 A Change in Thermal Unit

The following program is my ACcepted code for UVA-11984.
It's a for everybody to learn and discuss.
If there is any mistake or comment, please let me know.  :D

此乃UVA 11984 的AC code!
歡迎一同討論學習,如有錯誤與任何建議請留言 : )

點這裡看題目 Click here to see this Problem!

d = F1 - F2
-> 因為d是差距,所以在兩個F相減下會把32抵銷
-> Because d is the difference, the 2 F will balance the 32
-> C =  d * 5 / 9

//This program is for UVA 11984 A Change in Thermal Unit
//題目來源 Problem link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=229&page=show_problem&problem=3135
   
#include<stdio.h>

int main()
{
    int n;
    double C, d;
   
    scanf("%d", &n);
    for(int count = 1; count <= n; count++)
    {
        scanf("%lf %lf", &C, &d);
        C = C + (d * 5.0 / 9.0);
       
        printf("Case %d: %.2lf\n", count, C);
    }
    return 0;
}


Please feel free to use it after adding this blog as an reference. (http://autekroy.blogspot.tw) If there is any mistake or comment, please let me know. :D 

歡迎使用與分享任何內容,但請記得標示此部落格為出處。(http://autekroy.blogspot.tw/) 如果有發現任何的錯誤與建議請留言或跟我連絡。 : )

沒有留言:

張貼留言

請留下您的任何想法或建議!
Please leave any thought or comment!