求助

P1598 垂直柱状图

@[QWQAWAQWQAWA](/user/1009402) 把 `and` 改成 `&&` ```cpp #include<bits/stdc++.h> using namespace std; string s,u; int tt[26],mx,t; int main(){ while(cin>>u){ //if(u=="0")break; s+=u; } for(int j=0;j<s.size();j++){ if(s[j]>='A'&& s[j]<='Z'){ tt[s[j]-'A']++;//cout<<s[j]-'A'<<endl; mx=max(tt[s[j]-'A'],mx);} } //cout<<mx; for(int i=mx;i>=1;i--){ for(int j=0;j<26;j++){ if(tt[j]>=i)cout<<'*'; else cout<<' '; } cout<<endl; } for(char i='A';i<='Z';i++){ cout<<i; } return 0; } ```
by shoot_down @ 2024-02-03 21:12:53


@[shoot_down](/user/616964) ok
by QWQAWAQWQAWA @ 2024-02-07 13:52:35


|