Submission #7570211


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;cin>>s;
  vector<string> v;
  string now="";
  for(int i=0;i<s.size();i++){
    if(s[i]==' '){
      v.push_back(now);
      now="";
    }
    else now+=s.substr(i,1);
  }
  v.push_back(now);
  for(;;){
    int y=0;
    int c=0;
    for(int i=0;i<v.size();i++){
      if(v[i]=="not"){
        if(c<=1)c++;
        else{
          c=2;
        }
      }
      else{
        if(c<=1)c=0;
        else{
          v.erase(v.begin()+i-1);
          v.erase(v.begin()+i-2);
          y=1;
          break;
        }
      }
    }
    if(y==0)break;
  }
  for(int i=0;i<v.size()-1;i++){
    cout<<v[i]<<" ";
  }
  cour<<v.back()<<endl;
}

Submission Info

Submission Time
Task A - 二重否定除去法則
User ttttan
Language C++14 (GCC 5.4.1)
Score 0
Code Size 738 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:40:3: error: ‘cour’ was not declared in this scope
   cour<<v.back()<<endl;
   ^