#include<bits/stdc++.h> using namespace std; //三刷 int main(){ int m,n; while(cin>>m>>n){ int num[10]={0}; for(int i=m;i<=n;i++){ string ss = to_string(i); //to_string(i)将数字以字符形式输出 int len = ss.length(); for(int j=0; j<len; j++){ num[ss[j]-'0']++; } } for(int i=0; i<10; i++){ if(i==0) printf("%d", cishu[0]); else printf(" %d", cishu[i]); } printf("\n"); } return 0; } /* Main.cc: In function 'int main()': Main.cc:17:26: error: 'cishu' was not declared in this scope if(i==0) printf("%d", cishu[0]); ^~~~~ Main.cc:17:26: note: suggested alternative: 'coshl' if(i==0) printf("%d", cishu[0]); ^~~~~ coshl Main.cc:18:23: error: 'cishu' was not declared in this scope else printf(" %d", cishu[i]); ^~~~~ Main.cc:18:23: note: suggested alternative: 'coshl' else printf(" %d", cishu[i]); ^~~~~ coshl */ |
Double click to view unformatted code.