09 2011 档案

Section2.4
摘要:#include<stdio.h>int main(){ int N=12,i; float a,s=0; for(i=0;i<N;i++) { scanf("%f",&a); s=s+a; } printf("$%.2f\n",s/12);} 阅读全文

posted @ 2011-09-30 23:08 csushin 阅读(100) 评论(0) 推荐(0)

Section2.3
摘要:#include<stdio.h>int main(){ int i,u,n,d,t=0; while(scanf("%d%d%d",&n,&u,&d)!=EOF) { if(n==0&&u==0&&d==0) break; for(i=0;n-(u-d)*i>u;i++) { t=t+2; } t=t+1; printf("%d\n",t); t=0; }} 阅读全文

posted @ 2011-09-30 23:07 csushin 阅读(85) 评论(0) 推荐(0)

Section2.2
摘要:#include<stdio.h>int main(){ int a,b,c; while(scanf("%X%X",&a,&b)!=EOF) { c=a+b; printf("%d\n",c); }} 阅读全文

posted @ 2011-09-30 23:05 csushin 阅读(63) 评论(0) 推荐(0)

Section2.1
摘要:#include<stdio.h>int main(){ int N,a,b=0,s=0,i; while(scanf("%d",&N)==1) { if(N==0) break; for(i=0;i<N;i++) { scanf("%d",&a); if(a>b) s=6*(a-b)+5+s; else s=s+4*(b-a)+5; b=a; } printf("%d\n",s); a=0;s=0;N=0;b=0; }} 阅读全文

posted @ 2011-09-30 23:01 csushin 阅读(71) 评论(0) 推荐(0)