Submission #122547
Source Code Expand
#include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ string conv_at = "atcoder@"; string S; string T; do{ cin >> S; cin >> T; }while (S.size() == T.size() && S.size() >= 10 ); size_t length{ S.size() }; bool cond{true}; for (size_t i = 0; i < length && cond; ++i){ if (S.at(i) == '@'){ auto it = find_if(conv_at.begin(), conv_at.end(), [&](char c){return (T.at(i) == c); }); if (it == conv_at.end())cond = false; } else if (T.at(i) == '@'){ auto it = find_if(conv_at.begin(), conv_at.end(), [&](char c){return (S.at(i) == c); }); if (it == conv_at.end())cond = false; } else if (S.at(i) != T.at(i)){ cond = false; } } cout << (cond ? "you can win" : "you will lose") << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - AtCoderトランプ |
User | boxpurin |
Language | C++ (G++ 4.6.4) |
Score | 0 |
Code Size | 823 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:20:9: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default] ./Main.cpp:22:7: warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default] ./Main.cpp:25:9: error: ‘it’ does not name a type ./Main.cpp:25:90: error: expected primary-expression before ‘)’ token ./Main.cpp:25:90: error: expected ‘;’ before ‘)’ token ./Main.cpp:26:8: error: ‘it’ was not declared in this scope ./Main.cpp:29:9: error: ‘it’ does not name a type ./Main.cpp:29:90: error: expected primary-expression before ‘)’ token ./Main.cpp:29:90: error: expected ‘;’ before ‘)’ token ./Main.cpp:30:8: error: ‘it’ was not declared in this scope