上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 51 下一页
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=2552题意:中文。。。mark:无论输入是多少。。。输出都是1。代码:# include <stdio.h>int main (){ int T ; scanf ("%d", &T) ; while (T--) puts("1") ; return 0 ;} 阅读全文
posted @ 2012-02-19 08:29 Seraph2012 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=2551题意:中文,直接循环可搞。代码:# include <stdio.h>long long calc(long long x){ long long i, sum = 0 ; for (i = 1 ; ; i++) { sum += i*i*i ; if (sum >= x) break ; } return i ;}int main (){ int T, x ; scanf ("%d", &T) ; while (T--)... 阅读全文
posted @ 2012-02-19 08:16 Seraph2012 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=2550题意:中文。mark:2wa,没看清题意,还要按箭身长度排序,囧。代码:# include <stdio.h># include <stdlib.h>typedef struct NODE{ int a, b ;}NODE ;NODE num[100] ;int cmp(const void *a, const void *b){ NODE *p = (NODE*)a, *q = (NODE*)b ; return p->a - q->a ;}void outp 阅读全文
posted @ 2012-02-19 08:12 Seraph2012 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=2549题意:中文。mark:水题不解释。代码:# include <stdio.h># include <string.h>int main (){ int T ; int a, n, len ; char str[10] ; scanf ("%d", &T) ; while (T--) { scanf ("%d.%s %d", &a, str, &n) ; len = strlen(str) ; if (n < 阅读全文
posted @ 2012-02-19 07:55 Seraph2012 阅读(240) 评论(9) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=2548题意:中文。mark:著名的ooxx题。。。不解释。代码:# include <stdio.h># include <math.h>int main (){ int T ; double a, b, c, d ; scanf ("%d", &T) ; while (T--) { scanf ("%lf%lf%lf%lf", &a, &b, &c, &d) ; printf ("%.3l 阅读全文
posted @ 2012-02-19 07:51 Seraph2012 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=2547题意:中文。mark:其实就是求两点间距离,水。注意输入数据是实数。代码:# include <stdio.h># include <math.h>int main (){ int T ; double a, b, c, d ; scanf ("%d", &T) ; while (T--) { scanf ("%lf%lf%lf%lf", &a, &b, &c, &d) ; printf (&q 阅读全文
posted @ 2012-02-19 07:49 Seraph2012 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1722题意:中文。mark:公式,p+q-gcd(p,q)。证明不懂。。。见大牛博客。http://blog.sina.com.cn/s/blog_696187fd0100soe2.html代码:# include <stdio.h>int gcd(int p, int q){return p%q?gcd(q,p%q):q;}int main (){ int p, q ; while (~scanf ("%d%d", &p, &q)) printf (&q 阅读全文
posted @ 2012-02-19 07:45 Seraph2012 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1323题意:某数的真因子加起来比它大叫做ABUNDANT,比它小叫做DEFICIENT,相等叫做PERFECT。输入一个数,输出它是哪种情况。直接暴。代码:# include <stdio.h>int main (){ int n, ans, i ; puts ("PERFECTION OUTPUT") ; while (~scanf ("%d", &n),n) { for(i = 1,ans=0 ; i < n && a 阅读全文
posted @ 2012-02-16 10:27 Seraph2012 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1328题意:输入一个字符串,没个字符后移1位后输出。代码:# include <stdio.h>int main (){ int T, i, nCase = 1 ; char str[55] ; scanf ("%d", &T) ; while (T--) { scanf ("%s", str) ; for(i = 0 ; str[i] ; i++) str[i] = (str[i]-'A'+1)%26+'A' 阅读全文
posted @ 2012-02-16 10:08 Seraph2012 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1334题意:输出所有(1,200]区间上满足a^3==b^3+c^3+d^3的式子。mark:水题,枚举a、b、c,在[c,a-1]区间上二分求d后验证。n次wa,二分写得挫。代码:# include <stdio.h># include <math.h>int sqrt3(int num,int l,int r){ int mid = 210 ; if (l*l*l>num) return 0 ; if (r*r*r<num) return 210 ; while 阅读全文
posted @ 2012-02-16 10:01 Seraph2012 阅读(262) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 51 下一页