Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

WA到抓狂。。大牛请进orz

Posted by sfeve at 2010-05-18 17:25:20 on Problem 3765
#include <stdio.h>

int main() {
	int i, j, n, loc;
	char c[9][11], a, b;
	
	while(1) {
		for(i=0; i<9; i++) {
			for(j=0; j<11; j++) {
				c[i][j] = 0;
			}
		}
		scanf("%d", &n);
		if(n == 0) break;
		getchar();
		
		for(i=0; i<n; i++) {
			scanf("%c%d", &a, &loc);
			getchar();
			scanf("%c", &b);
			getchar();
			if(a >= 'A' && a <= 'I' && loc >= 0 && loc <= 10) {
				c[a-'A'][loc] = b;
			}		
		}
		
		printf("         _\n");
		printf("       _/%c\\_\n", c[4][10]); 
		printf("     _/%c\\_/%c\\_\n", c[3][9], c[5][9]);
		printf("   _/%c\\_/%c\\_/%c\\_\n", c[2][8], c[4][9], c[6][8]);
		printf(" _/%c\\_/%c\\_/%c\\_/%c\\_\n", c[1][7], c[3][8], c[5][8], c[7][7]);
		
		printf("/%c\\_/%c\\_/%c\\_/%c\\_/%c\\\n", c[0][6], c[2][7], c[4][8], c[6][7], c[8][6]);
		printf("\\_/%c\\_/%c\\_/%c\\_/%c\\_/\n", c[1][6], c[3][7], c[5][7], c[7][6]);
		
		printf("/%c\\_/%c\\_/%c\\_/%c\\_/%c\\\n", c[0][5], c[2][6], c[4][7], c[6][6], c[8][5]);
		printf("\\_/%c\\_/%c\\_/%c\\_/%c\\_/\n", c[1][5], c[3][6], c[5][6], c[7][5]);
		
		printf("/%c\\_/%c\\_/%c\\_/%c\\_/%c\\\n", c[0][4], c[2][5], c[4][6], c[6][5], c[8][4]);
		printf("\\_/%c\\_/%c\\_/%c\\_/%c\\_/\n", c[1][4], c[3][5], c[5][5], c[7][4]);
		
		printf("/%c\\_/%c\\_/%c\\_/%c\\_/%c\\\n", c[0][3], c[2][4], c[4][5], c[6][4], c[8][3]);
		printf("\\_/%c\\_/%c\\_/%c\\_/%c\\_/\n", c[1][3], c[3][4], c[5][4], c[7][3]);
		
		printf("/%c\\_/%c\\_/%c\\_/%c\\_/%c\\\n", c[0][2], c[2][3], c[4][4], c[6][3], c[8][2]);
		printf("\\_/%c\\_/%c\\_/%c\\_/%c\\_/\n", c[1][2], c[3][3], c[5][3], c[7][2]);
		
		printf("/%c\\_/%c\\_/%c\\_/%c\\_/%c\\\n", c[0][1], c[2][2], c[4][3], c[6][2], c[8][1]);
		printf("\\_/%c\\_/%c\\_/%c\\_/%c\\_/\n", c[1][1], c[3][2], c[5][2], c[7][1]);
		
		printf("/%c\\_/%c\\_/%c\\_/%c\\_/%c\\\n", c[0][0], c[2][1], c[4][2], c[6][1], c[8][0]);
		printf("\\_/%c\\_/%c\\_/%c\\_/%c\\_/\n", c[1][0], c[3][1], c[5][1], c[7][0]);
		
		printf("  \\_/%c\\_/%c\\_/%c\\_/\n", c[2][0], c[4][1], c[6][0]);
		printf("    \\_/%c\\_/%c\\_/\n", c[3][0], c[5][0]);
		printf("      \\_/%c\\_/\n", c[4][0]);
		printf("        \\_/\n");
	}
	
	return 1;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator