上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 51 下一页
摘要: 2011-12-15 03:28:10地址:http://acm.hdu.edu.cn/showproblem.php?pid=2500题意:中文,水。代码:# include <stdio.h>int main (){ int T, n, i, j ; scanf ("%d", &T) ; while (T--) { scanf ("%d", &n) ; for (i = 0 ; i < n*3 ; i++) { for (j = 0 ; j < n ; j++) print... 阅读全文
posted @ 2012-01-06 15:12 Seraph2012 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 03:18:50地址:http://acm.hdu.edu.cn/showproblem.php?pid=2073题意:中文。。。mark:用一种比较奇怪的写法来写的。代码:# include <stdio.h># include <math.h>typedef struct PT{ int x, y ;}PT ;int cmp(const void *a, const void *b){ PT *p = (PT*)a, *q = (PT*)b ; if (p->x + p->y != q->x + q->y) return 阅读全文
posted @ 2012-01-06 15:10 Seraph2012 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 03:01:19地址:http://acm.hdu.edu.cn/showproblem.php?pid=1061题意:求N^N的最后一位。mark:可以用快速幂,也可以直接用数论公式后循环。EulerPhi(10) = 4。代码:# include <stdio.h>int pp(int n, int m){ int i, mul = 1 ; for (i = 0 ; i < m ; i++) mul = (mul*n)%10 ; return mul % 10 ;}int main (){ int T, n ; scanf ... 阅读全文
posted @ 2012-01-06 15:09 Seraph2012 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 02:57:40地址:http://acm.hdu.edu.cn/showproblem.php?pid=2201题意:中文。。。mark:废话超多。其实就是求第一个数的倒数,和第二个数无关。代码:# include <stdio.h>int main (){ int n , m; while (~scanf ("%d%d", &n, &m)) printf ("%.2lf\n", 1.0/(double)n) ; return 0 ;} 阅读全文
posted @ 2012-01-06 15:06 Seraph2012 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 02:53:24地址:http://acm.hdu.edu.cn/showproblem.php?pid=2186题意:中文。。。最后一段之外都是剧情。地震,感慨。一晃快4年了。题目要写完满很麻烦,还好数据保证了很多情况不出现。代码:# include <stdio.h>int main (){ int n, T, a, b, c, ans ; scanf ("%d", &T) ; while (T--) { scanf ("%d", &n) ; a = n/2 ; b = (n-a)*2/3 ; ... 阅读全文
posted @ 2012-01-06 15:05 Seraph2012 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 02:43:48地址:http://acm.hdu.edu.cn/showproblem.php?pid=2162题意:输入一堆数,求和。代码:# include <stdio.h>int main (){ int n, sum, num ; int nCase = 1 ; while (~scanf ("%d", &n) && n > 0) { sum = 0 ; while (n--) { scanf ("%d", &num) ; sum += num ; ... 阅读全文
posted @ 2012-01-06 15:02 Seraph2012 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 02:48:00地址:http://acm.hdu.edu.cn/showproblem.php?pid=2163题意:判断是否是回文。。。代码:# include <stdio.h># include <string.h>int test(char str[]){ int i, len = strlen(str) ; for (i = 0 ; i < len/2 ; i++) if (str[i] != str[len-1-i]) return 0 ; return 1 ;}int main (){ int nCase = 1 ; ... 阅读全文
posted @ 2012-01-06 15:02 Seraph2012 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 02:39:10地址:http://acm.hdu.edu.cn/showproblem.php?pid=2160题意:中文。。。mark:直接用最暴力的递推水过。其实应该还是fibonacci。代码:# include <stdio.h>int main (){ int i, T, n ; int dp[25][3] ; dp[1][0] = 1 ; dp[1][1] = dp[1][2] = 0 ; for (i = 2 ; i <= 20 ; i++) { dp[i][0] = dp[i-1][0] + dp[i-1... 阅读全文
posted @ 2012-01-06 15:01 Seraph2012 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 02:28:25地址:http://acm.hdu.edu.cn/showproblem.php?pid=2140题意:给出加密的字符串,输出解密。加密规则在题中。mark:那个l很像1……wa了一次,没看数组范围,开了个100的,2B了。代码:# include <stdio.h>char tab[300] ;char str[10010] ;int main (){ int i ; char s1[] = "bqtmicael", s2[] = " ,!leacim" ; for (i = 0 ; i < 9 阅读全文
posted @ 2012-01-06 15:00 Seraph2012 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 2011-12-15 02:11:52地址:http://acm.hdu.edu.cn/showproblem.php?pid=2107题意:中文,找最大。代码:# include <stdio.h>int main (){ int n, a, max ; while (~scanf ("%d", &n)) { if (n == 0) break ; scanf ("%d", &max) ; while (n-- -1) { scanf ("%d", &a) ; if (a >... 阅读全文
posted @ 2012-01-06 14:59 Seraph2012 阅读(155) 评论(0) 推荐(0) 编辑
上一页 1 ··· 40 41 42 43 44 45 46 47 48 ··· 51 下一页