摘要: #include <stdio.h> #include <math.h> int main(){ int n; double x1,y1,x2,y2,dx,dy,dt; scanf("%d",&n); while(n--) { scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2); dx=x1-x2; dy=y1-y2; dt=sqrt(dx*dx+dy*dy); printf("%.2f\n",dt); } return 0; } 阅读全文
posted @ 2013-06-12 00:32 融雪残阳 阅读(1811) 评论(0) 推荐(1) 编辑
摘要: #include<stdio.h>int main(){ int a[11]; int n,i,count; scanf("%d",&n); while(n--) { for(count=i=0;i<=10;i++) scanf("%d",&a[i]); a[10]+=30; --i; while(i--) if(a[10]>=a[i]) count++; printf("%d\n",count); } return 0;} 阅读全文
posted @ 2013-06-12 00:12 融雪残阳 阅读(1070) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<math.h> int main() { int i,j,k; double sum; int n,N; scanf("%d",&n); while(n--) { sum=0; scanf("%d",&N); for(j=1;j<=N;j++) sum+=log10(j); k=(int)sum+1; printf("%d\n",k); } return 0; } 阅读全文
posted @ 2013-06-10 12:57 融雪残阳 阅读(2073) 评论(0) 推荐(0) 编辑
摘要: #include "stdio.h"int main(){ int m,n; scanf("%d",&m); while(m--) { scanf("%d",&n); if(n<=10&&n>1000000) return 0; if(n>10&&n<100) n%=10; else if(n<1000) n%=100; else if(n<10000) n%=1000; else if(n<100000) n%=10000; else if(n 阅读全文
posted @ 2013-06-09 09:02 融雪残阳 阅读(1393) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int main(){int n,i;scanf("%d",&n);for(i=0;i<n;i++){ int day,x1,x2;scanf("%d",&day);{ x2=1;while(day){ x1=(x2+1)*2; x2=x1; day--;}printf("%d\n",x1);}}return 0;} 阅读全文
posted @ 2013-06-07 23:06 融雪残阳 阅读(2206) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> int main() { int i,n; scanf("%d",&n); for(i=0;i<n;i++) { int j=0,m,t; scanf("%d",&m); while(m) { t=m%2; if(t==0) m=m/2; else { j++; m=m>>1; } } printf("%d\n",j); } return 0; } 阅读全文
posted @ 2013-06-07 22:25 融雪残阳 阅读(564) 评论(0) 推荐(1) 编辑
摘要: #include<stdio.h>#include<string.h>int main(){int N,i,k;char str[40],ch;scanf("%d",&N);ch=getchar();while(N--){ gets(str); k=strlen(str); for(i=k-1;i>=0;i--) if(str[i]>='a'&&str[i]<='z') printf("%c",str[i]); printf("\n"); 阅读全文
posted @ 2013-06-07 13:32 融雪残阳 阅读(383) 评论(0) 推荐(0) 编辑
摘要: #include "stdio.h"int main(){ int a,n; scanf("%d",&n); while(n--) { scanf("%d",&a); if(a>=90&&a<=100) printf("A\n"); else if(a>=80&&a<=89) printf("B\n"); else if(a>=70&&a<=79) printf("C\n"); 阅读全文
posted @ 2013-06-04 12:53 融雪残阳 阅读(3256) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>main(){int a,b,count,num,i;while(scanf("%d%d",&a,&b)!=EOF){if(a==0&&b==0) break ;count=0,num=0;for(i=0;i<3;i++){if((a%10+b%10+count)>=10){count=(a%10+b%10+count)/10;num++;}a/=10;b/=10;} printf("%d\n",num);} return 0; } 阅读全文
posted @ 2013-06-01 12:44 融雪残阳 阅读(3245) 评论(0) 推荐(1) 编辑