随笔分类 -  HDOJ

上一页 1 ··· 20 21 22 23 24

发布一些HDOJ的做题情况以及代码。
[恢]hdu 2026
摘要:2011-12-12 05:15:07地址:http://acm.hdu.edu.cn/showproblem.php?pid=2026题意:中文题。mark:小写转大写可以&0xDF来转。代码:# include <stdio.h>char str[110] ;int main (){ int i ; while (gets(str)) { for (i = 0 ; str[i] ; i++) { if (i == 0 || (str[i-1] == ' ' && str[i] != ' ')) ... 阅读全文

posted @ 2012-01-06 14:21 Seraph2012 阅读(174) 评论(0) 推荐(0)

[恢]hdu 2009
摘要:2011-12-12 05:04:42地址:http://acm.hdu.edu.cn/showproblem.php?pid=2009题意:中文题。代码:# include <stdio.h># include <math.h>int main (){ int m ; double n, sum ; while (~scanf ("%lf%d", &n, &m)) { sum = 0 ; while (m--) { sum += n ; n = sqrt(n) ; } ... 阅读全文

posted @ 2012-01-06 14:20 Seraph2012 阅读(156) 评论(0) 推荐(0)

[恢]hdu 1095
摘要:2011-12-12 04:55:58地址:http://acm.hdu.edu.cn/showproblem.php?pid=1095题意:a+b。。。代码(C编译):main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n\n",a+b);} 阅读全文

posted @ 2012-01-06 14:19 Seraph2012 阅读(104) 评论(0) 推荐(0)

[恢]hdu 2008
摘要:2011-12-12 05:01:03地址:http://acm.hdu.edu.cn/showproblem.php?pid=2008题意:中文题。代码:# include <stdio.h>int main (){ int n, a, b, c ; double num ; while (~scanf ("%d", &n) && n) { a = b = c = 0 ; while (n--){ scanf ("%lf", &num) ; num < 0 ? a ++ : num==0 ? b+... 阅读全文

posted @ 2012-01-06 14:19 Seraph2012 阅读(144) 评论(0) 推荐(0)

[恢]hdu 1094
摘要:2011-12-12 04:53:30地址:http://acm.hdu.edu.cn/showproblem.php?pid=1094题意:n个数字求和。mark:同1092一模一样。代码(C编译):main(n,a,b){while(~scanf("%d",&n)&&n){b=0;while(n--){scanf("%d",&a);b+=a;}printf("%d\n",b);}} 阅读全文

posted @ 2012-01-06 14:18 Seraph2012 阅读(130) 评论(0) 推荐(0)

[恢]hdu 1092
摘要:2011-12-12 04:49:22地址:http://acm.hdu.edu.cn/showproblem.php?pid=1092题意:每行第一个数是n,之后n个数。计算和。mark:没老老实实写,贡献了一个CE。代码(C编译):main(n,a,b){while(~scanf("%d",&n)&&n){b=0;while(n--){scanf("%d",&a);b+=a;}printf("%d\n",b);}} 阅读全文

posted @ 2012-01-06 14:17 Seraph2012 阅读(190) 评论(0) 推荐(0)

[恢]hdu 1093
摘要:2011-12-12 04:51:00地址:http://acm.hdu.edu.cn/showproblem.php?pid=1093题意:还是n个数的和,一共T组:mark:和1092只差一点点。代码(C编译):main(n,a,b){scanf("%d",&n);while(~scanf("%d",&n)&&n){b=0;while(n--){scanf("%d",&a);b+=a;}printf("%d\n",b);}} 阅读全文

posted @ 2012-01-06 14:17 Seraph2012 阅读(109) 评论(0) 推荐(0)

[恢]hdu 1090
摘要:2011-12-12 04:41:27地址:http://acm.hdu.edu.cn/showproblem.php?pid=1090题意:计算T组a+b。代码(C编译):main(a,b){scanf("%d",&a);while(~scanf("%d%d",&a,&b))printf("%d\n",a+b);} 阅读全文

posted @ 2012-01-06 14:16 Seraph2012 阅读(146) 评论(0) 推荐(0)

[恢]hdu 1091
摘要:2011-12-12 04:44:32地址:http://acm.hdu.edu.cn/showproblem.php?pid=1091题意:计算a+b,直到0 0。没检查清楚,贡献出了第一个WA。代码(C编译):main(a,b){while(~scanf("%d%d",&a,&b)&&(a||b))printf("%d\n",a+b);} 阅读全文

posted @ 2012-01-06 14:16 Seraph2012 阅读(101) 评论(0) 推荐(0)

[恢]hdu 1089
摘要:2011-12-12 04:39:43地址:http://acm.hdu.edu.cn/showproblem.php?pid=1089题意:同1000代码(C编译):main(a,b){while(~scanf("%d%d",&a,&b))printf("%d\n",a+b);} 阅读全文

posted @ 2012-01-06 14:15 Seraph2012 阅读(110) 评论(0) 推荐(0)

[恢]hdu 2005
摘要:2011-12-12 03:48:21地址:http://acm.hdu.edu.cn/showproblem.php?pid=2005题意:中文题。代码:# include <stdio.h># define LEAP(y) ((y)%4==0&&(y)%100!=0||(y)%400==0)int main (){ int month[2][13] = { {0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}, {0, 0, 31, 60, 91, 121, 152, 182, 213, 24... 阅读全文

posted @ 2012-01-06 14:14 Seraph2012 阅读(160) 评论(0) 推荐(0)

[恢]hdu 2006
摘要:2011-12-12 03:53:00地址:http://acm.hdu.edu.cn/showproblem.php?pid=2006题意:中文题代码:# include <stdio.h>int main (){ int n, num, mul ; while (~scanf ("%d", &n)) { mul = 1 ; while (n--) { scanf ("%d", &num) ; if(num&1) mul*=num ; } printf ("%d... 阅读全文

posted @ 2012-01-06 14:14 Seraph2012 阅读(144) 评论(0) 推荐(0)

[恢]hdu 2004
摘要:2011-12-12 03:41:00地址:http://acm.hdu.edu.cn/showproblem.php?pid=2004题意:中文。代码:# include <stdio.h>int main (){ int num ; char tab[] = "EEEEEEDCBAA" ; while (~scanf ("%d", &num)) { if (num < 0 || num > 100) puts ("Score is error!") ; else printf ("%c\n 阅读全文

posted @ 2012-01-06 14:13 Seraph2012 阅读(150) 评论(0) 推荐(0)

[恢]hdu 2002
摘要:2011-12-12 03:35:42地址:http://acm.hdu.edu.cn/showproblem.php?pid=2002题意:中文题。思路:球体体积公式:V=4*Pi*r*r*r/3.0代码:# include <stdio.h>#define PI 3.1415927int main (){ double r ; while (~scanf ("%lf", &r)) printf ("%.3lf\n", 4*PI*r*r*r/3.0) ; return 0 ;} 阅读全文

posted @ 2012-01-06 14:12 Seraph2012 阅读(150) 评论(0) 推荐(0)

[恢]hdu 2003
摘要:2011-12-12 03:38:15地址:http://acm.hdu.edu.cn/showproblem.php?pid=2003题意:中文题。代码:# include <stdio.h>int main (){ double a ; while (~scanf ("%lf", &a)) printf ("%.2lf\n", a>0?a:-a) ; return 0 ;} 阅读全文

posted @ 2012-01-06 14:12 Seraph2012 阅读(158) 评论(0) 推荐(0)

[恢]hdu 2001
摘要:2011-12-12 03:30:57地址:http://acm.hdu.edu.cn/showproblem.php?pid=2001题意:中文题。代码:# include <stdio.h># include <math.h>int main (){ double x1, y1, x2, y2 ; while (~scanf ("%lf%lf%lf%lf", &x1, &y1, &x2, &y2)) printf ("%.2lf\n", sqrt ((x1-x2)*(x1-x2) + (y1-y 阅读全文

posted @ 2012-01-06 14:11 Seraph2012 阅读(203) 评论(0) 推荐(0)

[恢]hdu 1001
摘要:2011-12-12 03:27:22地址:http://acm.hdu.edu.cn/showproblem.php?pid=1001题意:给出多组n,输出1+2+3...n的结果,并跟随一个空白行。代码:# include <stdio.h>int main (){ unsigned int n ; while (~scanf ("%d", &n)) printf ("%d\n\n", n*(n+1)/2) ; return 0 ;} 阅读全文

posted @ 2012-01-06 14:10 Seraph2012 阅读(197) 评论(0) 推荐(0)

[恢]hdu 1000
摘要:2011-12-12 03:08:00链接:http://acm.hdu.edu.cn/showproblem.php?pid=1000题意:输入多组a和b,输出a+b的和并换行。代码:# include <stdio.h>int main (){ int a, b ; while (~scanf ("%d%d", &a, &b)) printf ("%d\n", a+b) ; return 0 ;} 阅读全文

posted @ 2012-01-06 14:08 Seraph2012 阅读(135) 评论(0) 推荐(0)

上一页 1 ··· 20 21 22 23 24