摘要: 链接:http://acm.hdu.edu.cn/showproblem.php?pid=1001Problem DescriptionHey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n.InputThe input will consist of a series of integers n, one integer per line.OutputFor each case, o 阅读全文
posted @ 2011-04-01 19:50 淡墨æ末央 阅读(761) 评论(2) 推荐(0) 编辑
摘要: 链接:http://acm.hdu.edu.cn/showproblem.php?pid=1000超级水的题:View Code 1 #include<stdio.h>2 #define P 3.14159273 main()4 {5 int a,b;6 while(scanf("%d%d",&a,&b)==2)7 printf("%d\n",a+b);8 return 0;9 } 阅读全文
posted @ 2011-04-01 19:42 淡墨æ末央 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 快速排序qsort真的很强大一、对int类型数组排序int num[100];int cmp ( const void *a , const void *b ){return *(int *)a - *(int *)b;}qsort(num,100,sizeof(num[0]),cmp);二、对char类型数组排序(同int类型)char word[100];int cmp( const void *a , const void *b ){return *(char *)a - *(int *)b;}qsort(word,100,sizeof(word[0]),cmp);三、对double类. 阅读全文
posted @ 2011-04-01 15:27 淡墨æ末央 阅读(836) 评论(4) 推荐(0) 编辑