Submission #1516826


Source Code Expand

#include <stdio.h>
#include <string.h>
int main(void) {

	char S[10], T[10], atcoder[7] = { 'a', 't', 'c', 'o', 'd', 'e', 'r' };
	int len, i, j, co = 0;
	bool judge = true;

	scanf("%s %s", S, T);

	len = strlen(S);

	for (i = 0; i < len; i++) {
		if (S[i] != T[i]) {
			if (S[i] == '@') {
				for (j = 0; j < 7; j++) {
					if (T[i] != atcoder[j]) co++;
				}
				if (co == 7) {
					judge = false;
					co = 0;
					break;
				}
				co = 0;
			}
			else if (T[i] == '@') {
				for (j = 0; j < 7; j++) {
					if (S[i] != atcoder[j]) co++;
				}
				if (co == 7) {
					judge = false;
					co = 0;
					break;
				}
				co = 0;
			}
			else {
				judge = false;
				break;
			}
		}
	}

	if (judge) printf("You can win\n");
	else printf("You will lose");

	return 0;
}

Submission Info

Submission Time
Task B - AtCoderトランプ
User kajimoto
Language C (Clang 3.8.0)
Score 0
Code Size 814 Byte
Status CE

Compile Error

./Main.c:7:2: error: use of undeclared identifier 'bool'
        bool judge = true;
        ^
./Main.c:20:6: error: use of undeclared identifier 'judge'
                                        judge = false;
                                        ^
./Main.c:20:14: error: use of undeclared identifier 'false'; did you mean 'else'?
                                        judge = false;
                                                ^~~~~
                                                else
./Main.c:20:14: error: expected expression
./Main.c:31:6: error: use of undeclared identifier 'judge'
                                        judge = false;
                                        ^
./Main.c:31:14: error: use of undeclared identifier 'false'; did you mean 'else'?
                                        judge = false;
                                                ^~~~~
                                                else
./Main.c:31:14: error: expected expression
./Main.c:38:5: error: use of undeclared iden...