0pts,help

P1554 梦中的统计

修改后代码: ``` #include<bits/stdc++.h> using namespace std; int main(){ int a,b,s[10],idx=0,c=0; cin>>a>>b; for(int i=a; i<=b; i++) { c=i; while(c){ idx=c%10; s[idx]++; c/=10; } } for(int i=0; i<=9; i++) cout<<s[i]<<" "; return 0; } ``` [WA×10](https://www.luogu.com.cn/record/111467337)
by jfy2204 @ 2023-05-28 12:16:32


再次修改代码: ``` #include<bits/stdc++.h> using namespace std; int main(){ int a,b,s[10],idx=0,c=0; cin>>a>>b; for(int i=0; i<9; i++) s[i]=0; for(int i=a; i<=b; i++) { c=i; while(c){ idx=c%10; s[idx]++; c/=10; } } for(int i=0; i<=9; i++) cout<<s[i]<<" "; return 0; } ``` [WA×10](https://www.luogu.com.cn/record/111543800)
by jfy2204 @ 2023-05-28 21:53:41


终于.......... AC啦!!!!!!!!!!!!!!! ~~(才发现自己把<=写成了<的屑)~~
by jfy2204 @ 2023-05-28 22:00:10


自问自答
by Yaofangyu @ 2023-06-17 11:55:50


前排围观
by zizilino_y @ 2023-07-20 15:42:26


|