Submission #3018346


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
int main(){
    char a[10];
    gets(a);
    if(a[2]=='B') printf("Bachelor %c%c\n",&a[0],&a[1]);
    if(a[2]=='M') printf("Master %c%c\n",&a[0],&a[1]);
    if(a[2]=='D') printf("Doctor %c%c\n",&a[0],&a[1]);
    return 0;
}

Submission Info

Submission Time
Task A - ぼくの学生証
User Secret
Language C++14 (GCC 5.4.1)
Score 0
Code Size 268 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:5:11: error: ‘gets’ was not declared in this scope
     gets(a);
           ^
./Main.cpp:6:55: warning: format ‘%c’ expects argument of type ‘int’, but argument 2 has type ‘char*’ [-Wformat=]
     if(a[2]=='B') printf("Bachelor %c%c\n",&a[0],&a[1]);
                                                       ^
./Main.cpp:6:55: warning: format ‘%c’ expects argument of type ‘int’, but argument 3 has type ‘char*’ [-Wformat=]
./Main.cpp:7:53: warning: format ‘%c’ expects argument of type ‘int’, but argument 2 has type ‘char*’ [-Wformat=]
     if(a[2]=='M') printf("Master %c%c\n",&a[0],&a[1]);
                                                     ^
./Main.cpp:7:53: warning: format ‘%c’ expects argument of type ‘int’, but argument 3 has type ‘char*’ [-Wformat=]
./Main.cpp:8:53: warning: format ‘%c’ expects argument of type ‘int’, but argument 2 has type ‘char*’ [-Wformat=]
     if(a[2]=='D') printf("Doctor %c%c\n",&a[0],&a[1]);
                                             ...