Submission #2240889


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
inline int read{  
    int s=0,w=1;  
    char ch=getchar();  
    while(ch<='0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}  
    while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();  
    return s*w;  
}  
int main(){
    int n,m;
    cin>>n>>m;
    cout<<min(abs(n-m),10-abs(n-m))<<endl;
    return 0;
}

Submission Info

Submission Time
Task B - 錠
User luogu_bot4
Language C++ (GCC 5.4.1)
Score 0
Code Size 360 Byte
Status CE

Compile Error

./Main.cpp:3:12: error: ‘read’ declared as an ‘inline’ variable
 inline int read{  
            ^
./Main.cpp:3:16: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
 inline int read{  
                ^
./Main.cpp:4:5: error: expected primary-expression before ‘int’
     int s=0,w=1;  
     ^
./Main.cpp:4:5: error: expected ‘}’ before ‘int’
./Main.cpp:4:5: error: expected ‘,’ or ‘;’ before ‘int’
./Main.cpp:6:5: error: expected unqualified-id before ‘while’
     while(ch<='0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}  
     ^
./Main.cpp:7:5: error: expected unqualified-id before ‘while’
     while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();  
     ^
./Main.cpp:8:5: error: expected unqualified-id before ‘return’
     return s*w;  
     ^
./Main.cpp:9:1: error: expected declaration before ‘}’ token
 }  
 ^