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

Re:一次刷过。贴个代码:这个我不知道为什么WA。。。

Posted by etromtest at 2011-04-15 22:57:26 on Problem 2136
In Reply To:一次刷过。贴个代码: Posted by:0810311106 at 2009-09-12 16:48:15
#include <stdio.h>
#include <string.h>
char a[27][400]={0,};

int main(){
	int n=4,i,j;
	char buf[100];
	char c;
	int max=0;
	while(n--){
		gets(buf);
		for(i=0;i<strlen(buf);i++){
			if(buf[i]>='A' && buf[i]<='Z'){
				c=buf[i]-'A'+1;
				a[c][strlen(a[c])]='*';
				if(strlen(a[c])>max){
					max=strlen(a[c]);
				}
			}
		}
	}

	for(i=max-1;i>=0;i--){
		for(j=1;j<=26;j++){
			printf("%c",a[j][i]);
			if(j<26) printf(" ");
		}
		printf("\n");
	}
	for(i=1;i<=26;i++) {
		printf("%c",i+'A'-1);
		if(i<26) printf(" ");
	}
	return 0;
}

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