답안 #206649

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
206649 2020-03-04T11:11:10 Z mayhoubsaleh Split (info1cup19_split) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>

using namespace std;
string s;
int main(){
  cin>>s;
  for(int i=0;i<s.size()/2;i++){
    cout<<s[i];
  }
  cout<<' ':
  for(int i=s.size()/2;i<s.size();i++)cout<<s[i];cout<<endl;
  
}

Compilation message

split.cpp: In function 'int main()':
split.cpp:7:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i=0;i<s.size()/2;i++){
               ~^~~~~~~~~~~
split.cpp:10:12: error: expected ';' before ':' token
   cout<<' ':
            ^
split.cpp:11:24: error: 'i' was not declared in this scope
   for(int i=s.size()/2;i<s.size();i++)cout<<s[i];cout<<endl;
                        ^