为什么这个代码是错的,请大佬解答一下

P1598 垂直柱状图

@[yanhaoyang2106](/user/574849) 第一,一共就4行,你用 `while` 读是什么意思
by pengzy___ @ 2022-03-08 13:46:13


@[yanhaoyang2106](/user/574849) ```cpp for(int i=maxx;i>=1;i--){ for(int j=1;j<=26;j++) if(book[j]==i) {cout<<"*"<<" ";book[j]--;} ``` 改成这个试试 ```cpp for(i=maxx;i>0;i--){ for(j=0;j<26;j++) if(book[j]>=i)cout<<"* "; else cout<<' '; cout<<endl; } ```
by pengzy___ @ 2022-03-08 13:51:34


|