Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
133255 范恒恺 词组缩写 C++ Compile Error 0 MS 0 KB 406 2025-10-18 11:28:09

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; cin.get(); for(int i=1; i<=t; i++) { string s1; getline(cin,s1); for(int j=0; j<=s1.length()-1; j++) { if(j==0) { cout<<char(s1[0]-32); } } if(j==0&&s1[j]>='a'&&s1[j]<='z'){ cout<<char(s1-[0]-32); } if(s1[j]==' ') { cout<<char(s1[j+1]-32); } } cout<<endl; } }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=0; j<=s1.length()-1; j++) {
                 ^
Main.cc:14:7: error: 'j' was not declared in this scope
    if(j==0&&s1[j]>='a'&&s1[j]<='z'){
       ^
Main.cc:15:11: error: expected primary-expression before 'char'
     cout<