#include <iostream> using namespace std; int main(){ int n,c[26]; char str[1001]; scanf("%d",&n); while(n--){ scanf("%s",str); int len = strlen(str); for(int j=0;j<len;j++){ c[str[j]-'A']++; } for(int k=0;k<26;k++){ if(c[k]!=0){ printf("%d%c",c[k],'A'+k); } } printf("\n"); } return 0; } /* Main.cc: In function 'int main()': Main.cc:10:25: error: 'strlen' was not declared in this scope int len = strlen(str); ^ */ |
Double click to view unformatted code.