首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

P1005 I Think I Need a Houseboat - 水题

2012-10-16 
P1005 I Think I Need a Houseboat -- 水题#include stdio.h#include stdlib.hdouble pi 3.14159265

P1005 I Think I Need a Houseboat -- 水题

#include <stdio.h>#include <stdlib.h>double pi = 3.1415926535898;int main(int argc, char *argv[]){int cnt, i;float x, y;int year;scanf("%d", &cnt);for (i=1; i<=cnt; i++) {scanf("%f %f", &x, &y);double temp = pi * (x*x + y*y) / 100.0;year = temp;year += (temp - year > 0.0) ? 1 : 0;printf("Property %d: This property will begin eroding in year %d.\n", i, year);}printf("END OF OUTPUT.");return 0;}

热点排行