Language: C++

#include<iostream>
using namesoace std;

int main(){
   int a,b,c,d;
   cin >>a>>b>>c>>d;

   if(a-c <=d && a-c>=-d){
      cout << "Yes" << endl;
   }
   else if(a<=b<=c && b-a<=d && c-b<=d){
      cout << "Yes" << endl;
   }
   else if(a>=b>=c && a-b<=d && b-c<=d){
      cout << "Yes" << endl;
   }
   else{
      cout <<"No" <<endl;
   }
   return 0;
}

#include<iostream>
using namespace std;

int main(){
   int a,b,c,d;
   cin >>a>>b>>c>>d;

   if(a-c <=d && a-c>=-d){
      cout << "Yes" << endl;
   }
   //else if(a<=b<=c && b-a<=d && c-b<=d){
      cout << "Yes" << endl;
   }
   //else if(a>=b>=c && a-b<=d && b-c<=d){
      cout << "Yes" << endl;
   }
   else{
      cout <<"No" <<endl;
   }
   return 0;
}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namesoace'
    2 | using namesoace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:4: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |    cin >>a>>b>>c>>d;
      |    ^~~
      |    std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |       cout << "Yes" << endl;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |       cout << "Yes" << endl;
      |                        ^~~~
      |                        std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:12:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |       cout << "Yes" << endl;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |       cout << "Yes" << endl;
      |                        ^~~~
      |                        std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:15:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |       cout << "Yes" << endl;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |       cout << "Yes" << endl;
      |                        ^~~~
      |                        std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:18:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |       cout <<"No" <<endl;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   18 |       cout <<"No" <<endl;
      |                     ^~~~
      |                     std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc: At global scope:
a.cc:26:5: error: redefinition of 'int main()'
   26 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
a.cc:37:7: error: 'cout' does not name a type
   37 |       cout << "Yes" << endl;
      |       ^~~~
a.cc:38:4: error: expected declaration before '}' token
   38 |    }
      |    ^
a.cc:39:4: error: expected unqualified-id before 'else'
   39 |    else{
      |    ^~~~
a.cc:42:4: error: expected unqualified-id before 'return'
   42 |    return 0;
      |    ^~~~~~
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^