摘要: 地址: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 阅读(175) 评论(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 阅读(304) 评论(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 阅读(163) 评论(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 阅读(242) 评论(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 阅读(134) 评论(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 阅读(202) 评论(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 阅读(166) 评论(0) 推荐(0) 编辑