POJ Volume1练习记录
来源:互联网 发布:青海网络电视台 编辑:程序博客网 时间:2024/06/06 01:45
昨天开始在POJ上做题,作为菜鸟,先做简单的咯,争取天天都做吧,Hang on~
1003
#include<iostream>using namespace std;/**POJ 1003*Author :Biang Hoo*July 27 2013*/int main(){double c;while(cin>>c&& c !=0.00){double sum=0.00;int i=2;while(sum<c){sum += (1.0/i);i++;}cout<<(i-2)<<" card(s)"<<endl;}return 0;}
1004
#include<iostream>using namespace std;/**POJ 1004*Author :Biang Hoo*July 27 2013*/int main(){int i=0;double balance;double avg =0.0;while(cin>>balance && balance !=0 && i != 12){i++;avg += balance;}cout<<"$"<<(avg/12.00)<<endl;return 0;}
1005
#include<iostream>#include<math.h>using namespace std;/**POJ 1005*Author :Biang Hoo*July 27 2013*/int main(){int i;float x;float y;float area;cin>>i;for(int j=0;j<i;j++){cin>>x>>y;float r2 =x*x+y*y;area = (3.14*r2)/2;float year =ceil(area/50.0);cout<<"Property "<<(j+1)<<": This property will begin eroding in year "<<year<<"."<<endl; }cout<<"END OF OUTPUT."<<endl;return 0;}
1006
#include<iostream>using namespace std;/*Poj 1006*Author Biang Hoo*July 28 2013*/int main(){int p,e,i,d;int Case = 0;while(cin>>p>>e>>i>>d&& p != -1 && e != -1 && i != -1 && d != -1&&d <= 365){Case++;int peak=1;bool flag = false;while(!flag){if((peak-p)%23 == 0 && peak != d ){if((peak-e)%28 == 0){if((peak-i)%33==0){if(peak-d>0){flag = true;break;}}}}peak++;}cout<<"Case "<<Case<<": the next triple peak occurs in "<<(peak-d)<<" days."<<endl;}return 0;}
- POJ Volume1练习记录
- [翻译练习]UNIX Network Programming Volume1, Third Edition 1.1(001)
- 记录练习poj题的一些痕迹和记忆一
- 练习记录
- uva Volume1 BigNumber 总结
- uva volume1 100
- (记录)练习的记录
- 缓冲区溢出练习记录
- Linux练习记录
- openstack 练习记录
- shiny--练习记录
- SQL Server2005练习记录
- Kotlin项目练习记录
- 代码练习记录
- c++编程练习记录
- poj 练习大全
- kmp练习 poj 2541
- poj 3481 treap 练习
- ubuntu+nginx安装配置应用说明
- Weka学习实验总结
- iptables的移植
- 读书: 《一句顶一句》
- C++对象的内存布局
- POJ Volume1练习记录
- uva 548 -Tree
- poj 2942 Knights of the Round Table 点双连通
- Weka入门教程(1)
- ios6下cocos2d截屏失效问题处理
- STM32(Cortex-M3)中优先级的概念
- Weka入门教程(2)
- poj 2406 最短循环周期
- Weka入门教程(3)