Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
7061 赖梓乐 07切比雪夫距离 C++ Compile Error 0 MS 0 KB 583 2025-04-04 16:14:37

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a,s,d,f; cin>>a>>s>>d>>f; int b=d-a,c=f-s; if(b<0){ b=b*(-1); } else{ if(c<0){ c=c*-1; } else{ if(c<b);{ cout<<b; else{ cout<<c; } } } } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:21:16: error: 'else' without a previous 'if'
                else{
                ^