上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 34 下一页

2012年10月14日

hdu 1013 Digital Roots (找规律)

摘要: 点击打开链接 ps: n=0 1 2 3 4 5 6 7 8 9 10 11 12 13 ......... 100 101 102 103 .... roots=0 1 2 3 4 5 6 7 8 9 1 2 3 4 .......1 2 3 4.... 原来是以1.....9为循环... 阅读全文

posted @ 2012-10-14 17:38 Slege 阅读(81) 评论(0) 推荐(0) 编辑

hdu1266 Reverse Number (模拟)

摘要: 点击打开链接 ps:按题目意思进行处理#include"stdio.h"#include"string.h" int main() { char str1[111],str2[111]; int t,n,m,len,i,j; scanf("%d",&t); ... 阅读全文

posted @ 2012-10-14 17:38 Slege 阅读(109) 评论(0) 推荐(0) 编辑

hdu 1708 Fibonacci String (递推)

摘要: 点击打开链接 ps:先推出字符串,然后再计算字母个数,会因字符串太长而wrong,应直接用字母的个数进行递推! #include#includeint ans[55][27];int main(){ int n,i,j,t; char s1[31],s2[33]; scanf("%d",&t... 阅读全文

posted @ 2012-10-14 17:37 Slege 阅读(106) 评论(0) 推荐(0) 编辑

hdu 1720 A+B Coming (进制转换)

摘要: 点击打开链接 ps:输入16进制的方法#include"stdio.h" int main() { int a,b; while(scanf("%x%x",&a,&b)!=EOF) printf("%d\n",a+b); return 0; } ... 阅读全文

posted @ 2012-10-14 17:37 Slege 阅读(79) 评论(0) 推荐(0) 编辑

hdu 2103 Family planning (水)

摘要: 点击打开链接 #include "stdio.h"#include "math.h"int main(){ int t; int n,m; int count; int num; int flag; int i; double sum; scanf("%d",&t); while(t--) ... 阅读全文

posted @ 2012-10-14 17:37 Slege 阅读(64) 评论(0) 推荐(0) 编辑

hdu 3782 xxx定律 (水)

摘要: 点击打开链接 #includeint main(){ int n,count; while(scanf("%d",&n)!=EOF&&n!=0) { count=0; while(n>1) { if(n%2==0) n/=2; else n=(3*n+1)/2; count... 阅读全文

posted @ 2012-10-14 17:37 Slege 阅读(81) 评论(0) 推荐(0) 编辑

hdu3783 ZOJ (水)

摘要: 点击打开链接 ps:变一下思路#include int main() { int a,b,c,i; char str[111],ch[3]; while(gets(str)&&str[0]!='E') { a=b=c=0; ch[0]='Z'... 阅读全文

posted @ 2012-10-14 17:37 Slege 阅读(73) 评论(0) 推荐(0) 编辑

hdu 2114 Calculate S(n) (递推)

摘要: 点击打开链接 ps:立方和公式:1^3 + 2^3 + …… n^3 = [n (n+1) / 2]^2=(1+2+……+n)^2 #includevoid main(){ int n; int sum; while(scanf("%d",&n)!=EOF) { ... 阅读全文

posted @ 2012-10-14 17:36 Slege 阅读(111) 评论(0) 推荐(0) 编辑

2012年9月2日

hdu 2111 Saving HDU (DP)

摘要: 点击打开链接 ps:动态规划 -装箱 #include #include struct fun { int p,m; }a[105]; int cmp(const void*a,const void *b) { struct fun *c=(st... 阅读全文

posted @ 2012-09-02 09:28 Slege 阅读(86) 评论(0) 推荐(0) 编辑

hdu 2080 夹角有多大II (数学)

摘要: 点击打开链接 PS:夹角用余弦定理:c*c=b*b+a*a-2*b*a*cos(C); a=sqrt(x1*x1+y1*y1);----1 b=sqrt(x2*x2+y2*y2);----2 m=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); 由以上... 阅读全文

posted @ 2012-09-02 09:27 Slege 阅读(112) 评论(0) 推荐(0) 编辑

上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 34 下一页

导航