上一页 1 ··· 5 6 7 8 9 10 11 下一页
  2011年7月15日
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>int main(){ int t; while(scanf("%d",&t)!=EOF) { if(t<0||t>100)//刚开始这里错了,放到switch里面去了,后面看了题目条件是小于0和大于100的才输出下面的内容,看来做题不能想当然了。 printf("Score is error!\n"); else { switch(t/10) { case 10: case 9: printf 阅读全文
posted @ 2011-07-15 20:51 枫叶飘泪 阅读(332) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>int main(){ double a; while(scanf("%lf",&a)!=EOF) { printf("%.2lf\n",fabs(a)); } //system("pause"); return 0;} 阅读全文
posted @ 2011-07-15 18:07 枫叶飘泪 阅读(235) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>#define PI 3.1415927int main(){ double r,v; while(scanf("%lf",&r)!=EOF) { v=(4*PI*r*r*r)/3; printf("%.3lf\n",v); } //system("pause"); return 0;} 阅读全文
posted @ 2011-07-15 17:56 枫叶飘泪 阅读(382) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>int main(){ double x1,x2,y1,y2,s; while(scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2)!=EOF) { s=sqrt(((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))); printf("%.2lf\n",s); } // system("pau 阅读全文
posted @ 2011-07-15 17:50 枫叶飘泪 阅读(462) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>int cmp(const void *a,const void *b){ return *(char *)a-*(char *)b;}int main(){ char a[3]; while(scanf("%s",a)!=EOF) { qsort(a,3,sizeof(a[0]),cmp); printf("%c %c %c\n",a[0],a[1],a[2]); } //system("pause&q 阅读全文
posted @ 2011-07-15 17:32 枫叶飘泪 阅读(442) 评论(0) 推荐(0) 编辑
  2011年6月22日
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>#define MAXSIZE 100int n,m;typedef struct { char name[20]; int num; int yuwen; int shuxue; int yinyu;}DataType;typedef struct { DataType data[MAXSIZE]; int last;}seqlist;seqlist *A1,*A2,*A3,*A4,*A6;struct In{ int sum; int nums; c 阅读全文
posted @ 2011-06-22 16:24 枫叶飘泪 阅读(384) 评论(1) 推荐(0) 编辑
  2011年6月8日
摘要: 通过这个测试可知:在初始化赋值时,不能连续赋值,然而在分开定义后,在进行额外赋值时,可以连续赋值。#include<stdio.h>#include<stdlib.h>int main(){ /*int a=b=1;*///wrong int a,b;//right a=b=1; printf("%d %d\n",a,b); system("pause"); return 0;} 阅读全文
posted @ 2011-06-08 21:15 枫叶飘泪 阅读(138) 评论(0) 推荐(0) 编辑
  2011年5月31日
摘要: 题目:Problem D Problem DescriptionEddy's interest is very extensive, recently he is interested in prime number. Eddy discover the all number owned can be divided into the multiply of prime number, but he can't write program, so Eddy has to ask intelligent you to help him, he asks you to write 阅读全文
posted @ 2011-05-31 22:36 枫叶飘泪 阅读(214) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>#define Max 100int prime[Max+5];void fun( ){ memset( prime,0,sizeof( prime ) );//假设MAX内所有数都是素数并赋值为0 for( int i = 2; i <= Max / 2; ++i )//分别找出所有2--MAX/2内的所有数的倍数并赋值为1,标记为非素数 for( int j = i + i; j <= Max; j += i ) prime[j] = 1 阅读全文
posted @ 2011-05-31 20:21 枫叶飘泪 阅读(192) 评论(0) 推荐(0) 编辑
  2011年5月28日
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>struct T{ T *ch[26]; int n,flag;}rt;char in[15];void init(T *t){ for(int i=0;i<26;i++) { t->ch[i]=NULL; } t->n=t->flag=0;}void insert(T *t,char *in){ if(*in) { if(t->ch[*in-'a']==NULL) { t->ch[*in-'a 阅读全文
posted @ 2011-05-28 10:37 枫叶飘泪 阅读(187) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 下一页