洛谷评测机和本地编译结果不同
查看原帖
洛谷评测机和本地编译结果不同
741591
ZhengHQ9234楼主2023/10/8 21:53

同一份代码 本地ACAC,评测机CECE,在线IDE OLEOLE。

bdfs无果,求助。

#include<bits/stdc++.h>
using namespace std;
int main(){
	int a[27];
	char c[10001];
	int maxn=0;
	for(int i=0;i<4;i++){
		gets(c);
		for(int j=0;j<strlen(c);j++){
			if(isupper(c[i])){
				a[c[j]-'A']++;
			}
		}
	}
	for(int i=0;i<26;i++){
		maxn=max(maxn,a[i]);
	}
	for(int i=maxn;i>0;i--){
		for(int j=0;j<25;j++){
			if(a[j]==i){
				cout<<'*';
				a[j]--;
			} 
			else cout<<' ';
			cout<<' ';
		}
		if(a[25]==i){
			cout<<'*';
			a[25]--;
		}
		else cout<<' ';
		cout<<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";
	return 0;
}
2023/10/8 21:53
加载中...