Run ID:116835

提交时间:2025-04-12 17:05:19

#include <bits/stdc++.h> using namespace std; int main() { char s[10005]; cin>>s; for(int i=0;i<strlen(s);i++){ if(s[i]>='a'){ s[i]-=32; } } char c=s[0]; int l=0; for(int j=0;j<=strlen(s);j++){ if(s[j]==c){ l+=1; } else{ cout<<"("<<s[j-1]<<","<<l<<")" ; c=s[j+1]; l=1; } } return 0; }