提出 #4233012
ソースコード 拡げる
#define F_in(s) freopen(s".in","r",stdin) #define F_out(x) freopen(x".out","w",stdout) #define lal long long int #include<algorithm> #include<iostream> #include<cstring> #include<cstdio> #include<cmath> using namespace std; lal i,j,k,n; string a[5],b[5],c[5]; int main() { //F_in(""); //F_out(""); scanf("%s%s%s",a,b,c); bool x=true; if(a[0]=='n' || a[1]=='o' || a[2]=='t') { x=!x; if(b[0]=='n' || b[1]=='o' || b[2]=='t') { x=!x; if(c[0]=='n' || c[1]=='o' || c[2]=='t') { x=!x; if(x) { if(a[0]!='n' && a[1]!='o' && a[2]!='t') printf("%c%c%c",a[0],a[1],a[2]); else if(b[0]!='n' && b[1]!='o' && b[2]!='t') printf("%c%c%c",b[0],b[1],b[2]); else if(c[0]!='n' && c[1]!='o' && c[2]!='t') printf("%c%c%c",c[0],c[1],c[2]); } else printf("%c%c%c %c%c%c %c%c%c",a[0],a[1],a[2],b[0],b[1],b[2],c[0],c[1],c[2]); } else { if(x) { if(a[0]!='n' && a[1]!='o' && a[2]!='t') printf("%c%c%c",a[0],a[1],a[2]); else if(b[0]!='n' && b[1]!='o' && b[2]!='t') printf("%c%c%c",b[0],b[1],b[2]); else if(c[0]!='n' && c[1]!='o' && c[2]!='t') printf("%c%c%c",c[0],c[1],c[2]); } else printf("%c%c%c %c%c%c %c%c%c",a[0],a[1],a[2],b[0],b[1],b[2],c[0],c[1],c[2]); } } else { x=!x; if(c[0]=='n' || c[1]=='o' || c[2]=='t') { x=!x; if(x) { if(a[0]!='n' && a[1]!='o' && a[2]!='t') printf("%c%c%c",a[0],a[1],a[2]); else if(b[0]!='n' && b[1]!='o' && b[2]!='t') printf("%c%c%c",b[0],b[1],b[2]); else if(c[0]!='n' && c[1]!='o' && c[2]!='t') printf("%c%c%c",c[0],c[1],c[2]); } else printf("%c%c%c %c%c%c %c%c%c",a[0],a[1],a[2],b[0],b[1],b[2],c[0],c[1],c[2]); } else { if(x) { if(a[0]!='n' && a[1]!='o' && a[2]!='t') printf("%c%c%c",a[0],a[1],a[2]); else if(b[0]!='n' && b[1]!='o' && b[2]!='t') printf("%c%c%c",b[0],b[1],b[2]); else if(c[0]!='n' && c[1]!='o' && c[2]!='t') printf("%c%c%c",c[0],c[1],c[2]); } else printf("%c%c%c %c%c%c %c%c%c",a[0],a[1],a[2],b[0],b[1],b[2],c[0],c[1],c[2]); } } } return 0; }
提出情報
提出日時 | |
---|---|
問題 | A - 二重否定除去法則 |
ユーザ | luogu_bot1 |
言語 | C++ (GCC 5.4.1) |
得点 | 0 |
コード長 | 2245 Byte |
結果 | CE |
コンパイルエラー
./Main.cpp: In function ‘int main()’: ./Main.cpp:16:22: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘std::string* {aka std::basic_string<char>*}’ [-Wformat=] scanf("%s%s%s",a,b,c); ^ ./Main.cpp:16:22: warning: format ‘%s’ expects argument of type ‘char*’, but argument 3 has type ‘std::string* {aka std::basic_string<char>*}’ [-Wformat=] ./Main.cpp:16:22: warning: format ‘%s’ expects argument of type ‘char*’, but argument 4 has type ‘std::string* {aka std::basic_string<char>*}’ [-Wformat=] ./Main.cpp:18:9: error: no match for ‘operator==’ (operand types are ‘std::string {aka std::basic_string<char>}’ and ‘char’) if(a[0]=='n' || a[1]=='o' || a[2]=='t') ^ In file included from /usr/include/c++/5/utility:70:0, from /usr/include/c++/5/algorithm:60, from ./Main.cpp:4: /usr/include/c++/5/bits/stl_pair.h:214:5: note: candidate: template<class _T1, class _T2> bool std::operator==(const std::pair<_T1, _T2>&, const s...