Submission #1836837


Source Code Expand

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;

string s1;
string s2;

vector<char> words = {'a','t','c','o','d','e','r','@'};

inline char change(char c)
{
    if(find(words.begin(),words.end(),c) == words.end()) return c;
    return '@';
}

int main()
{
    cin >> s1;
    cin >> s2;

    for(int i = 0;i < s1.size();i++)
    {
        if((change(s1[i]) != s2[i]) || (change(#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;

string s1;
string s2;

vector<char> words = {'a','t','c','o','d','e','r','@'};

inline char change(char c)
{
    if(find(words.begin(),words.end(),c) == words.end()) return c;
    return '@';
}

int main()
{
    cin >> s1;
    cin >> s2;

    for(int i = 0;i < s1.size();i++)
    {
        if((change(s1[i]) != s2[i]) || (change(s2[i]) != s1[i]) || (s1[i] != s2[i]))
        {
            cout << "You will lose" << endl;
            return 0;
        }
    }

    cout << "You can win" << endl;
    return 0;
}s2[i]) != s1[i]) || s1[i] != s2[i])
        {
            cout << "You will lose" << endl;
            return 0;
        }
    }

    cout << "You can win" << endl;
    return 0;
}

Submission Info

Submission Time
Task B - AtCoderトランプ
User niuez
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1284 Byte
Status CE

Compile Error

./Main.cpp:25:48: error: stray ‘#’ in program
         if((change(s1[i]) != s2[i]) || (change(#include <iostream>
                                                ^
./Main.cpp: In function ‘int main()’:
./Main.cpp:25:49: error: ‘include’ was not declared in this scope
         if((change(s1[i]) != s2[i]) || (change(#include <iostream>
                                                 ^
./Main.cpp:25:66: error: expected primary-expression before ‘>’ token
         if((change(s1[i]) != s2[i]) || (change(#include <iostream>
                                                                  ^
./Main.cpp:29:1: error: expected primary-expression before ‘using’
 using namespace std;
 ^
./Main.cpp:29:20: error: expected ‘)’ before ‘;’ token
 using namespace std;
                    ^
./Main.cpp:29:20: error: expected ‘)’ before ‘;’ token
./Main.cpp:37:1: error: a function-definition is not allowed here before ‘{’ token
 {
 ^
./Main.cpp:43:1: error: a function-definition is not allowed here before ‘{’ token
 {
 ^
...