[恢]hdu 2074
2012-01-06 22:14
330 查看
2011-12-17 07:47:56
地址:http://acm.hdu.edu.cn/showproblem.php?pid=2074
题意:中文。模拟。
代码:
地址:http://acm.hdu.edu.cn/showproblem.php?pid=2074
题意:中文。模拟。
代码:
# include <stdio.h> # include <string.h> char out[110][110] ; void gao(int n, char a[2]) { memset (out, 0, sizeof(out)) ; if (n == 1){ putchar (a[0]) ; puts ("") ; return ; } int s = 0, t = n-1, tm, i, j ; int flag = ((n+1)/2 + 1) % 2 ; for (tm = 0 ; tm < (n+1)/2 ; tm++) { for (i = s ; i <= t ; i++) for(j = s; j <= t ; j++) out[i][j] = a[flag] ; flag = !flag ; s++, t-- ; } out[0][0] = out[0][n-1] = out[n-1][0] = out[n-1][n-1] = ' ' ; for (i = 0 ; i < n ; i++) puts (out[i]) ; } int main () { int num, nCase = 1 ; char ch[2]; while (~scanf ("%d %c %c%*c", &num, &ch[0], &ch[1])) { if (nCase++ != 1) printf ("\n") ; gao(num, ch) ; } return 0 ; }
相关文章推荐
- hdu-oj 2074 叠筐
- HDU 2074 叠筐 (字符处理)
- hdu 2074 叠框
- hdu 2074 输出图形
- HDU 2074 叠筐
- HDU - 2074
- hdu 2074 堆放篮 好开心图纸标题
- HDU 2074 叠筐
- hdu 2074 叠筐(数论)
- HDU_2074 叠筐
- HDU 2074 叠筐
- hdu 2074 叠筐
- hdu 2074 叠筐
- hdu 2074 叠筐 好有意思的绘图题
- hdu 2074
- hdu 2074 叠筐
- HDU 2074 叠筐(基础字符串处理)
- hdu 4544 叛逆的小明 -- 数字反转 和 hdu 2074 叠筐(水题)
- HDU_2074叠筐
- HDU 2074 叠筐