提交时间:2024-10-24 20:59:19
运行 ID: 101985
#include <iostream> using namespace std; int main(){ int a; cin>>a; char b[a][123],c[a][123]; for(int i=0;i<a;i++) cin>>b[i]; int d=0; for(int i=0;i<a;i++,d=0){ if(b[i][0]>='A'&&b[i][0]<='Z') c[i][0]=b[i][0]; else c[i][0]=b[i][0]-32; for(int j=0;b[i][j]!='\0';j++){ if(b[i][j]=='_'&&b[i][j+1]!='_'){ d++; if(b[i][j+1]>='A'&&b[i][j+1]<='Z') c[i][d]=b[i][j+1]; else c[i][d]=b[i][j+1]-32; } } c[i][d+1]='\0'; } for(int i=0;i<a;i++){ for(int j=0;c[i][j]!='\0';j++){ cout<<c[i][j]; } cout<<endl; } return 0; }