Submission #3594618
Source Code Expand
#include<bits//stdc++.h> using namespace std; int main(){ string a; cin>>a; int x=a.size(); for(int i=0;i<x;i++){ if(i==x-1&&(a[x-1]=="a"||a[x-1]=="b"||a[x-1]=="c"||a[x-1]=="d"||a[x-1]=="e")){ } else if(i==x-1&&a[x-1]!="a"&&a[x-1]!="b"&&a[x-1]!="c"&&a[x-1]!="d"&&a[x-1]!="e"){ cout<<a[x-1]<<endl; } else if(a[i]=="a"||a[i]=="b"||a[i]=="c"||a[i]=="d"||a[i]=="e"){ } else{ cout<<a[i]; } } }
Submission Info
Submission Time | |
---|---|
Task | B - 罠 |
User | tada72 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 485 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:8:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(i==x-1&&(a[x-1]=="a"||a[x-1]=="b"||a[x-1]=="c"||a[x-1]=="d"||a[x-1]=="e")){ ^ ./Main.cpp:8:39: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(i==x-1&&(a[x-1]=="a"||a[x-1]=="b"||a[x-1]=="c"||a[x-1]=="d"||a[x-1]=="e")){ ^ ./Main.cpp:8:52: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(i==x-1&&(a[x-1]=="a"||a[x-1]=="b"||a[x-1]=="c"||a[x-1]=="d"||a[x-1]=="e")){ ^ ./Main.cpp:8:65: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(i==x-1&&(a[x-1]=="a"||a[x-1]=="b"||a[x-1]=="c"||a[x-1]=="d"||a[x-1]=="e")){ ^ ./Main.cpp:8:78: error: ISO C++ forbids comparison between pointer and integ...