2017年5月15日 星期一

ITSA 54 - [Problem 3] 電路板溫度升高問題 - 參考答案

Difficulty: Eazy
Ref: ITSA 54 - [Problem 3] 電路板溫度升高問題
/*******************************************************/
/* ITSA 54 - [Problem 3] 電路板溫度升高問題              */
/* Author: awei0905  [at]  awei0905.blogspot.tw        */
/* Version: 2017/05/15                                 */
/*******************************************************/
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>

int main() {
 int m;
 scanf("%d", &m);
 while (m--) {
  double Ti;
  int i;
  scanf("%lf,%d", &Ti, &i);
  printf("%2.4lf\n", Ti + 2.71828 * (1 + i) * i / 2);
 }
}
Debug: I/O
很明顯是在算三角形面積。(底乘高除以2)
10
94.87,9
94.87,8
94.87,7
94.87,6
94.87,5
94.87,4
94.87,3
94.87,2
94.87,1
94.87,0
217.1926
192.7281
170.9818
151.9539
135.6442
122.0528
111.1797
103.0248
97.5883
94.8700

沒有留言:

張貼留言