POJ 1005
来源:互联网 发布:mac book pro型号大全 编辑:程序博客网 时间:2024/05/29 12:12
/* * poj_1005.c * accepted */#include <stdio.h>#include <stdlib.h>#include <string.h>#define PI (3.14159265)#define EPS (1e-6)#define EROSION_YEAR (50)#define LINE_SIZE (70)static int poj_1005 (double d1, double d2);int main (int argc, char * argv[]){int i;int n_t;double d_t1, d_t2;char str[LINE_SIZE];char (* buf_out)[LINE_SIZE] = NULL;scanf ("%d", &n_t);buf_out = (char (*)[LINE_SIZE]) malloc ( n_t * LINE_SIZE);buf_out[0][0] = '\0';for (i=1; i<=n_t; i++){scanf ("%lf%lf", &d_t1, &d_t2);sprintf (str, "Property %d: This property will begin eroding in year %d.\n", i, poj_1005 (d_t1, d_t2));strcat (buf_out[0], str);}printf ("%sEND OF OUTPUT.\n", buf_out);if ( buf_out){free (buf_out);}return 0;}static int poj_1005 (double d1, double d2){int i=0;while (PI*(d1*d1+d2*d2) - 2*EROSION_YEAR*i > EPS){i++;}return i;}
- POJ 1005
- POJ-1005
- POJ 1005
- poj 1005
- POJ 1005
- POJ 1005
- POJ 1005
- POJ-1005
- POJ 1005
- poj 1005
- POJ 1005
- poj 1005
- poj 1005
- POJ 1005
- poj 1005
- poj 1005
- poj 1005
- POJ-1005
- OpenNI笔记2:Ubuntu下OpenNI驱动安装
- SubClassWindow详解
- php 调用谷歌翻译
- struts2中得到checkbox的值:
- 10306 - e-Coins
- POJ 1005
- 使用Jdeveloper进行工程调试时出现 IO异常的解决
- JavaScrip单线程引擎工作原理
- Oracle使用游标循环调用存储过程
- 今日收获总结(关于存储过程时间查询的一些方法以及字段截取的函数及调用示例)
- Andorid编程心得-利用代码解决Android WIFI休眠后连接断开的问题
- 计算机专业就业
- hdu4474-Yet Another Multiple Problem
- Java线程之ThreadLocal