Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
126982 邹子涵 词组缩写 C++ Compile Error 0 MS 0 KB 641 2025-07-23 09:15:56

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { // char a[50],n,b[50]; // cin>>n; // for(int i=1;i<=n;i++) // { // cin>>a[i]; // for(int j=0;j<50;j++) // if(a[j]%2==0) // { // b[j+1]=a[j]; // b[j]=a[j+1]; // } // } // cout<<a[i]<<" "<<b[i]; int n; cin>>n; char str[120]; getchar(); while(n--) { cin.getline(str,120) bool flag=true; for(int i=0;str[i]!='\0';i++) { if(flag&&str[i] !=' ') { char tmp=str[i] if(str[i]>='a'&&str[i]<='z') tmp-=32; cout<<tmp; flag=false; } else if(str[i]==' ') flage=true; } cout<<endl; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:26:3: error: expected ';' before 'bool'
   bool flag=true;
   ^
Main.cc:29:7: error: 'flag' was not declared in this scope
    if(flag&&str[i] !=' ')
       ^
Main.cc:32:5: error: expected ',' or ';' before 'if'
     if(str[i]>='a'&&str[i]<='z')
     ^
Main.cc:38:5: error: 'flage' was not declared in this scope
     flage=true;
     ^
Main.cc:41:2: error: expected '}' at end of input
  }
  ^