摘要:
2011-12-15 22:56:08地址:http://acm.hdu.edu.cn/showproblem.php?pid=1076题意:求y之后第n个闰年是哪年(如果y是闰年,y算第一年)。代码:# include <stdio.h>int IsLeap(int y){ if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) return 1 ; return 0 ;}int nextleapyear(int y){ int rtn = y+1 ; while (!IsLeap(rtn)) rtn++ ; ... 阅读全文
posted @ 2012-01-06 16:07
Seraph2012
阅读(142)
评论(0)
推荐(0)
摘要:
2011-12-15 15:06:33地址:http://acm.hdu.edu.cn/showproblem.php?pid=1064题意:求12个数的平均数- -。代码:# include <stdio.h>int main (){ int i ; double sum = 0, num ; for (i = 0 ; i < 12 ; i++) { scanf ("%lf", &num) ; sum += num ; } printf ("$%.2lf\n", sum/12.0) ; return 0 ;} 阅读全文
posted @ 2012-01-06 16:04
Seraph2012
阅读(100)
评论(0)
推荐(0)
摘要:
2011-12-15 14:49:48地址:http://acm.hdu.edu.cn/showproblem.php?pid=1049题意:有个蜗牛,每分钟向上爬u,第二分钟休息,下滑d。问几分钟能爬到n长的杆顶。mark:肯定是有公式,但处理边界麻烦,直接模拟。代码:# include <stdio.h>int main (){ int n, u, d, minutes, cur ; while (~scanf ("%d%d%d", &n, &u, &d) && (n||u||d)) { cur = 0, minute 阅读全文
posted @ 2012-01-06 16:03
Seraph2012
阅读(117)
评论(0)
推荐(0)
摘要:
2011-12-15 15:02:44地址:http://acm.hdu.edu.cn/showproblem.php?pid=1062题意:倒序单词输出。mark:wa了一次,把范围1000看成100, 2B了。代码:# include <stdio.h>char str[1100] ;char word[1100] ;void gao(char str[]){ word[100] = '\0' ; int i, cnt = 99 ; for (i = 0 ; str[i] ; i++) { if (str[i] == ' ') { ... 阅读全文
posted @ 2012-01-06 16:03
Seraph2012
阅读(154)
评论(0)
推荐(0)
摘要:
2011-12-15 14:45:28地址:http://acm.hdu.edu.cn/showproblem.php?pid=2115题意:nba技巧赛,输入人名,分钟,秒钟。按时间少到多排序,并输出rank。mark:PE一次,每组case之间空一行。代码:# include <stdio.h># include <stdlib.h># include <string.h> typedef struct NODE{ char name[50] ; int mm, ss ;}NODE ;NODE node[20] ;int cmp(const void * 阅读全文
posted @ 2012-01-06 16:01
Seraph2012
阅读(161)
评论(0)
推荐(0)
摘要:
2011-12-15 14:28:07地址:http://acm.hdu.edu.cn/showproblem.php?pid=2520题意:中文。。。找规律,n^2。注意long long。代码:# include <stdio.h> int main (){ long long n ; scanf ("%I64d", &n) ; while (~scanf ("%I64d", &n)) { n = n*n % 10000 ; printf ("%I64d\n", n) ; } return 0 ;} 阅读全文
posted @ 2012-01-06 15:59
Seraph2012
阅读(135)
评论(0)
推荐(0)
摘要:
2011-12-15 07:09:00纪念~。本来说今天只做25题的,晚上实在没事,做做就接近百题了,干脆冲百。今天一共做了50题,难度明显比以前大了。 阅读全文
posted @ 2012-01-06 15:57
Seraph2012
阅读(109)
评论(0)
推荐(0)
摘要:
2011-12-15 07:04:57地址:http://acm.hdu.edu.cn/showproblem.php?pid=2123题意:做一个N*N的乘法表,第i行第j个表示i*j。代码:# include <stdio.h>int main (){ int n, i, j ; scanf ("%d", &n) ; while (~scanf ("%d", &n)) { for (i = 1 ; i <= n ;i++) { for (j = 1 ; j <= n ;j++) if (... 阅读全文
posted @ 2012-01-06 15:55
Seraph2012
阅读(137)
评论(0)
推荐(0)
摘要:
2011-12-15 07:08:43地址:http://acm.hdu.edu.cn/showproblem.php?pid=2030题意:中文。汉字的ascii码二进制最高位是1。代码:# include <stdio.h>char str[1100] ;int calc (char str[]){ int i, sum = 0 ; for (i = 0 ; str[i] ; i++) if (str[i] & 0x80) sum++, i++ ; return sum ;}int main (){ int T ; scanf ("%d%*c",.. 阅读全文
posted @ 2012-01-06 15:55
Seraph2012
阅读(108)
评论(0)
推荐(0)
摘要:
2011-12-15 07:01:39地址:http://acm.hdu.edu.cn/showproblem.php?pid=2103题意:叙述了一个超生罚款的政策。一对夫妇如果生了超过M个小孩,或者已经生有男孩还继续生孩子,罚款。每次罚款的数额是上一次的2倍,一开始是10000。mark:wa了2次,把10000写成了1000,各种2。注意要long long。代码:# include <stdio.h>int main (){ int i, T, m, n ; int flag, num ; long long sum, cur ; scanf ("%d" 阅读全文
posted @ 2012-01-06 15:54
Seraph2012
阅读(153)
评论(0)
推荐(0)

浙公网安备 33010602011771号