| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
郁闷呀,考虑了多种情况且输出都正确,但就是ac不了啊!!不知哪位高手能帮忙找出错误所在,发到邮箱里,地址:267400433@163.com 万分感激啊!!#include<iostream>
#include<string>
using namespace std;
int main(){
int jl[26],temp,flag,judge=0;
string l[26][108];
char s[80];
for(int j=0;j<26;j++)
jl[j]=0;
for(int r=0;r<4;r++){
cin.getline(s,80);
temp=0;
while(temp<80){
flag=s[temp]-65;
if(flag>=0&&flag<=25) jl[flag]+=1;
temp++;
}
for(int t=0;t<80;t++)
s[t]=' ';
}
for(int k=25;k>=0;k--){
if(jl[k]>=judge){
judge=jl[k];
for(int m=0;m<judge;m++)
l[k][m]="*";
}
else {
for(int n=0;n<jl[k];n++)
l[k][n]="*";
for(int o=jl[k];o<judge;o++)
l[k][o]=" ";
}
}
for(int p=judge-1;p>=0;p--){
for(int q=0;q<25;q++){
if(l[q+1][p]==" "||l[q+1][p]=="*")
cout<<l[q][p]<<" ";
else{
cout<<l[q][p];
}
}
cout<<l[25][p]<<endl;
}
cout<<"A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"<<endl;
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator