上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 34 下一页

2012年9月2日

hdu 1860 统计字符 (水)

摘要: 点击打开链接 题目意思:输入两个字符串,输出第一个字符串中各个字符的个数!,注意空格也算,还有相同字符的情况下,要重复输出! #include #include #define M 88 int main() { char str[M],s[6]; int cnt[6],i,j; whi... 阅读全文

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

hdu3079 Vowel Counting (strlwr(将字符串中的字母转换为小写);strupr(转换为大写))

摘要: 点击打开链接 题目意思:将元音字母转换为大写,其他为小写 string:strlwr(将字符串中的字母转换为小写);strupr(转换为大写) #include #include int main() { int t,i; char str[55]; scanf("%d"... 阅读全文

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

hdu 3953 I'll play a trick on you (递推)

摘要: 题目很坑爹!!!规律是让两个数的个位数字相加!! #include #include int main() { int t; int i,j; char a[200],b[200]; int sum; scanf("%d\n",&t); for(i... 阅读全文

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

hdu 3817 Triangle (水)

摘要: 点击打开链接 题目意思:判断一个三角形是钝角还是锐角还是直角 #include int main() { int n,a,b,c,k=1; scanf("%d",&n); while(n--) { scanf("%d %d %d",&a,&b,&... 阅读全文

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

hdu 1248 寒冰王座 (水)

摘要: 点击打开链接 题目意思:买东西,有三种价格的商品150 200 350,商店不找零,所以多余的钱给商店,求给商店的最少的钱 暴力求解!! #include int main() { int t,a,b,c,n,i,j,k,max,temp; scanf("%d",&t); ... 阅读全文

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

hdu 2504 又见GCD (水)

摘要: 点击打开链接 题目意思:给你两个数a和b,找到一个最小的数c,使a和c的最大公约数为b #include int gcd(int x,int y)//求最大公约数 { while(x>y?(x%=y):(y%=x));//这里的分号不要丢了 return x+y; } int main()... 阅读全文

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

hdu 2560 Buildings (水)

摘要: 点击打开链接 水题!找n*m数组中,值为1的个数! #include int main() { int i,j,n,m,sum,t,a; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); sum=0; for(i=0;i<n... 阅读全文

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

hdu 2740 Root of the Problem (水)

摘要: 点击打开链接 题目意思很简单,给你一个b和一个n,找到一个a使a^n最接近b 先求出a=b^(1/n),然后再它附近找, #include #include void main() { float B,N,A1,A2,A3,A; scanf("%f%f",&B,&N); wh... 阅读全文

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

2012年8月6日

hdu 2521 反素数 (水)

摘要: 点击打开链接 题目具有迷惑性,第一句的反素素与题目没关系! 题目意思是求,一个区间中的最大素数 #includeint main(){ int i,j,n,m,max,t,tt,count[5555]; count[0]=0;count[1]=1;count[2]=2;count[... 阅读全文

posted @ 2012-08-06 16:12 Slege 阅读(106) 评论(0) 推荐(0) 编辑

hdu2734 Quicksum (水)

摘要: 点击打开链接 当是回车时,认为value是0,就没进行加,但,计数cnt要++;导致出错!!! #include#includeint main(){ char str[1111]; int sum,i,cnt; while(gets(str),str[0]!='#') { sum=0;c... 阅读全文

posted @ 2012-08-06 16:12 Slege 阅读(66) 评论(0) 推荐(0) 编辑

上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 34 下一页

导航