摘要:
http://poj.org/problem?id=1008按第一种记录方法算出总天数,然后按第二种记录方式输出。#include#includechar Hab[20][11] = { "","pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", & 阅读全文
摘要:
http://poj.org/problem?id=1005#include#include#include const double pi = acos(-1.0);int main(){ int t,j; scanf("%d",&t); for (int i = 1;i = 1.0/2*(pi*r)) break; cnt++; } printf("Property %d: This property will begin eroding in year %d.\n",i, cnt); } ... 阅读全文
摘要:
http://poj.org/problem?id=1003题意:最上面的卡片露出它下面卡片的1/2,第二个上面的卡片露出它下面的1/3,......,依次类推。。求能放的卡片数。。。#include#includeint main(){ double len; while(~scanf("%lf",&len)&&len) { double sum = 0; int i; for ( i = 2;; i ++) { sum +=1.0/i; if(sum >= len) ... 阅读全文
摘要:
http://poj.org/problem?id=1046纯水题。。找距离最短的输出。。#include#includeconst int INF=1<<28;struct node{ int r; int g; int b;} a[20];int main(){ int i,r1,g1,b1,dis,pos; for (i = 0 ; i < 16; i ++) { scanf("%d%d%d",&a[i].r,&a[i].g,&a[i].b); } while(1) { int min = INF; ... 阅读全文
摘要:
http://poj.org/problem?id=2000#includeconst int N=10010;int main(){ int coin[N]; long long n,i = 1,j,k; j = 1; k = 0; while (i = j) { k = 0; j++; } } while(~scanf("%lld",&n)&&n) { long long scoin = 0; for (i = 1; i <= n; i ++... 阅读全文
摘要:
http://poj.org/problem?id=1218题意:门的状态有两种开或关,初始化为开,每次进行状态转换,第一次把门号是1的倍数的门状态转换,第二次把门号是2的倍数的门状态转换,......,第n次把状态是n的倍数的门状态转换,输出最后有几个门是开的状态。#include#includeint main(){ int i, t,a[1010],n; scanf("%d",&t); while(t--) { scanf("%d",&n); memset(a,0,sizeof(a)); for (i = 1; i <= .. 阅读全文
摘要:
http://poj.org/problem?id=2017 1 #include 2 int main() 3 { 4 int n,mile,hour; 5 while(~scanf("%d",&n)&&n!=-1) 6 { 7 int sum = 0,h = 0; 8 while(n--) 9 {10 scanf("%d%d",&mile,&hour);11 h = hour-h;12 sum += mile*h;13 h ... 阅读全文