上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 51 下一页
摘要: 2011-12-16 10:33:26地址:http://acm.hdu.edu.cn/showproblem.php?pid=1219题意:统计小写字母出现的次数。代码:# include <stdio.h># include <string.h>char str[100010] ;int tab[300] ;int main (){ int i; while (gets(str)) { memset (tab, 0, sizeof(tab)) ; for (i = 0 ; str[i] ; i++) tab[str[i]... 阅读全文
posted @ 2012-01-06 17:28 Seraph2012 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 10:39:00地址:http://acm.hdu.edu.cn/showproblem.php?pid=1339题意:给出n,输出o, p满足n == o*2^p,其中o是奇数。代码:# include <stdio.h>int main (){ int n, p ; scanf ("%d", &n) ; while (~scanf ("%d", &n)) { p = 0 ; while (n % 2 == 0) n/=2, p++ ; printf ("%d %d\n", n, p 阅读全文
posted @ 2012-01-06 17:28 Seraph2012 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 10:28:49地址:http://acm.hdu.edu.cn/showproblem.php?pid=1161题意:把大写变成小写后输出。。。代码:# include <stdio.h>int main (){ int ch ; while ((ch = getchar ()) != EOF) { if (ch >= 'A' && ch <= 'Z') putchar (ch -'A' + 'a') ; else putchar (ch) ; } return 0 阅读全文
posted @ 2012-01-06 17:27 Seraph2012 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 10:26:02地址:http://acm.hdu.edu.cn/showproblem.php?pid=1012题意:按那个公式输出前9项。。。没有输入。代码:# include <stdio.h>int main (){ int i; double sum = 2.5 ; int fact = 2 ; puts("n e") ; puts ("- -----------") ; puts ("0 1") ; puts ("1 2") ; puts ("2 2.5&qu 阅读全文
posted @ 2012-01-06 17:26 Seraph2012 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 08:30:42今天仍然水了50题,开始比较吃力了,各种dp都出来了。勉强还罩得住。150题了,目标是周末200题。 阅读全文
posted @ 2012-01-06 17:25 Seraph2012 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 08:28:00地址:http://acm.hdu.edu.cn/showproblem.php?pid=1028题意:一个整数n,可以表示为多少种和的形式。mark:dp[i][j]表示和为j且和里面最大的数字不超过i的种类数,有dp[i][j] = dp[i-1][j] + dp[i][j-i]。代码:# include <stdio.h>int dp[130][130] ;int main (){ int i, j, n ; dp[0][0] = 1 ; for (i = 1 ; i <= 120 ; i++) { for (j... 阅读全文
posted @ 2012-01-06 17:24 Seraph2012 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 08:04:18地址:http://acm.hdu.edu.cn/showproblem.php?pid=1048题意:解码。。。没啥好说的。代码:# include <stdio.h># include <string.h>char ts[] = "VWXYZABCDEFGHIJKLMNOPQRSTU" ;char str[210] ;void gao(){ int i ; for (i = 0 ; str[i] ; i++) { if (str[i] >= 'A' && str[i] & 阅读全文
posted @ 2012-01-06 17:23 Seraph2012 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 08:14:58地址:http://acm.hdu.edu.cn/showproblem.php?pid=1004题意:给出n个字符串,输出出现的最多的那个。代码:# include <stdio.h># include <string.h>typedef struct node{ char name[20] ; int num ;}node ;node a[1010] ;int cnt ;void add(char name[]){ int i ; for (i = 0 ; i < cnt ; i++) { if (0 == ... 阅读全文
posted @ 2012-01-06 17:23 Seraph2012 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 07:52:18地址:http://acm.hdu.edu.cn/showproblem.php?pid=2069题意:有1、5、10、25、50一共五种硬币,问取不超过100枚组成n的种类有多少。mark:一开始没看到不超过100枚的条件。这题母函数不好做,直接dp吧。dp[i][j][k]表示用前i种硬币j枚组成面额k的种类数,转移方程是dp[i][j][k] = dp[i-1][j][k] +dp[i][j-1][k-tab[i]]。数据小,各种暴力吧。代码:# include <stdio.h>int dp[5][110][300] ;int ans[ 阅读全文
posted @ 2012-01-06 17:22 Seraph2012 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 2011-12-16 07:58:56地址:http://acm.hdu.edu.cn/showproblem.php?pid=1020题意:把给的字符串编码,如sample。代码:# include <stdio.h>char str[10010] ;int calc(char s[]){ int i, cnt = 0 ; for (i = 0 ; s[i] ; i++) { if (s[i] != s[0]) break ; cnt++ ; } return cnt ;}int main (){ int T, i, n ; ... 阅读全文
posted @ 2012-01-06 17:22 Seraph2012 阅读(143) 评论(0) 推荐(0) 编辑
上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 51 下一页