摘要:
2011-12-14 05:14:05地址:http://acm.hdu.edu.cn/showproblem.php?pid=2000题意:中文。。。代码:# include <stdio.h>char max(char c1, char c2){return c1>c2?c1:c2;}char min(char c1, char c2){return c1<c2?c1:c2;}int main (){ char a,b,c,aa,bb,cc ; while (~scanf ("%c%c%c",&a,&b,&c)) { ge 阅读全文
摘要:
2011-12-14 05:05:59地址:http://acm.hdu.edu.cn/showproblem.php?pid=2040题意:中文。代码:# include <stdio.h>int gao(int n){ int i, sum = 0 ; for (i =1 ; i < n ; i++) if (n%i==0) sum += i ; return sum ;}int main (){ int T, a, b ; scanf ("%d", &T) ; while (T--) { scanf ("%d%d", .. 阅读全文
摘要:
2011-12-14 04:59:10地址:http://acm.hdu.edu.cn/showproblem.php?pid=2033题意:中文,时间相加。代码:# include <stdio.h>int main (){ int T ; int h, m, s, hh, mm, ss ; scanf ("%d", &T) ; while (T--) { scanf ("%d%d%d%d%d%d", &h, &m, &s, &hh, &mm, &ss) ; s += ss ; if 阅读全文
摘要:
2011-12-14 05:02:21地址:http://acm.hdu.edu.cn/showproblem.php?pid=2039题意:中文,判断合法三角形。mark:wa了一次。输入的是实数不是int,坑爹。代码:# include <stdio.h>int main (){ int T ; double a, b, c ; scanf ("%d", &T) ; while (T--) { scanf ("%lf%lf%lf", &a, &b, &c) ; if (a+b<=c || b+c< 阅读全文
摘要:
2011-12-14 04:47:31地址:http://acm.hdu.edu.cn/showproblem.php?pid=2032题意:中文。代码:# include <stdio.h>int tri[35][35] ;void output (int n){ int i, j ; for (i = 0 ; i < n ; i++) { for (j = 0 ; j < i+1 ; j++) if (j == 0) printf ("%d", tri[i][j] ) ; else printf (" %d", t... 阅读全文
摘要:
2011-12-14 04:53:04地址:http://acm.hdu.edu.cn/showproblem.php?pid=2042题意:中文。。。递推。代码:# include <stdio.h>int dp[35] = {3} ;int main (){ int i, n, num ; for (i = 1 ; i <= 30 ; i++) dp[i] = (dp[i-1]-1) * 2 ; scanf ("%d", &n) ; while (n--) { scanf ("%d", &num) ; printf 阅读全文
摘要:
2011-12-14 04:39:31地址:http://acm.hdu.edu.cn/showproblem.php?pid=2020题意:中文代码:# include <stdio.h># include <stdlib.h>int a[110] ;int abs(int n){return n<0?-n:n;}int cmp(const void *a, const void *b){ int aa = *(int*)a, bb = *(int*)b ; return abs(bb)-abs(aa) ;}int main (){ int i, n ; whi 阅读全文
摘要:
2011-12-14 04:21:57地址:http://acm.hdu.edu.cn/showproblem.php?pid=2016题意:中文。mark:wa了2次,a^=b^=a^=b这种交换只能用在a和b不同的时候,否则清零。没考虑第一个元素就是最小值的情况。代码:# include <stdio.h>int a[110] ;int main (){ int i, n, pos ; while (~scanf ("%d", &n) && n) { for (i = 0 ; i < n ;i++) scanf ("% 阅读全文
摘要:
2011-12-14 04:31:11地址:http://acm.hdu.edu.cn/showproblem.php?pid=2019题意:中文。代码:# include <stdio.h># define INF 0x7f7f7f7fint flag ;void output (int num){ if (flag == 0) flag = 1; else putchar (' ') ; printf ("%d", num) ;}int main (){ int n, m, num ; while (~scanf ("%d%d&qu 阅读全文
摘要:
2011-12-14 03:57:54地址:http://acm.hdu.edu.cn/showproblem.php?pid=2007题意:中文。。。mark:wa了一次,忽略了m和n大小关系不固定。代码:# include <stdio.h>int main (){ int i, a1, a2, n, m ; while (~scanf ("%d%d", &n, &m)) { a1 = a2 = 0 ; if (n > m) n^=m^=n^=m ; for (i = n ; i <= m ; i++) { ... 阅读全文