Submission #2242863


Source Code Expand

#include<iostream>
using namspace std;
int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9')
    {
        if(ch=='-')
        {
            f=-1;
        }
        ch=getchar();
    }
    while(ch>='0'&&ch<='9')
    {
        x=x*10+ch-'0';
        ch=getchar();
    }
    return x*f;
}
int main()
{
    int n=read();
    cout<<(n+1)%12;
}

Submission Info

Submission Time
Task A - 来月は何月?
User luogu_bot1
Language C++ (GCC 5.4.1)
Score 0
Code Size 360 Byte
Status CE

Compile Error

./Main.cpp:2:7: error: expected nested-name-specifier before ‘namspace’
 using namspace std;
       ^
./Main.cpp: In function ‘int read()’:
./Main.cpp:5:33: error: ‘getchar’ was not declared in this scope
     int x=0,f=1;char ch=getchar();
                                 ^
./Main.cpp: In function ‘int main()’:
./Main.cpp:24:5: error: ‘cout’ was not declared in this scope
     cout<<(n+1)%12;
     ^
./Main.cpp:24:5: note: suggested alternative:
In file included from ./Main.cpp:1:0:
/usr/include/c++/5/iostream:61:18: note:   ‘std::cout’
   extern ostream cout;  /// Linked to standard output
                  ^