criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <string.h>
int W, a, b;
void solve() {
	int ans;
	if (a < b) {
		if ((b - (a + W)) < 0) {
			ans = 0;
		}
		else {
			ans = b - (a + W);
		}
	}
	else {
		if ((a - (b + W)) < 0) {
			ans = 0;
		}
		else {
			ans = a - (b + W);
		}
	}
	printf("%d\n", ans);
}

int main()
{
	// 標準入力から入力
	scanf_s("%d %d %d", &W, &a, &b);
	solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:21:9: error: 'printf' was not declared in this scope
   21 |         printf("%d\n", ans);
      |         ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include <string.h>
  +++ |+#include <cstdio>
    2 | int W, a, b;
a.cc: In function 'int main()':
a.cc:27:9: error: 'scanf_s' was not declared in this scope
   27 |         scanf_s("%d %d %d", &W, &a, &b);
      |         ^~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
              int a,b;
              cin >> a >> b;
if (a==H)
	if(b==H)            {
                            cout << "H" << endl;
              }
        else {
                            cout << "D" << endl;
              }
else if (b==H) {
                            cout << "D" << endl;
              }
        else {
                            cout << "H" << endl;
              }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: 'H' was not declared in this scope
    7 | if (a==H)
      |        ^
Language: C++

#include <iostream>
using namespace std;
int main()
{
              int a,b;
              cin >> a >> b;
if (a==H)
	if(b==H)            {
                            cout  "H" << endl;
              }
        else {
                            cout  "D" << endl;
              }
else if (b==H) {
                            cout  "D" << endl;
              }
        else {
                            cout  "H" << endl;
              }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: 'H' was not declared in this scope
    7 | if (a==H)
      |        ^
a.cc:9:33: error: expected ';' before string constant
    9 |                             cout  "H" << endl;
      |                                 ^ ~~~
      |                                 ;
a.cc:12:33: error: expected ';' before string constant
   12 |                             cout  "D" << endl;
      |                                 ^ ~~~
      |                                 ;
a.cc:15:33: error: expected ';' before string constant
   15 |                             cout  "D" << endl;
      |                                 ^ ~~~
      |                                 ;
a.cc:18:33: error: expected ';' before string constant
   18 |                             cout  "H" << endl;
      |                                 ^ ~~~
      |                                 ;
Language: C

#include <stdio.h>
 
int main(void)
   {
       int a.b;
       printf ("A.Bは正直者？嘘つき？");
       scanf ("%d",&a,&b);
 
       if (a=H,b=H)
         printf ("H");
       else if (a=D,b=H)
         printf ("D");
       else if (a=H,b=D)
         printf ("D");
       else if (a=D,b=D)
         printf ("H");
 
       return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:5:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    5 |        int a.b;
      |             ^
main.c:5:13: error: expected expression before '.' token
main.c:7:21: error: 'a' undeclared (first use in this function)
    7 |        scanf ("%d",&a,&b);
      |                     ^
main.c:7:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:24: error: 'b' undeclared (first use in this function)
    7 |        scanf ("%d",&a,&b);
      |                        ^
main.c:9:14: error: 'H' undeclared (first use in this function)
    9 |        if (a=H,b=H)
      |              ^
main.c:11:19: error: 'D' undeclared (first use in this function)
   11 |        else if (a=D,b=H)
      |                   ^
Language: C++

#include<stdio.h>

int main()
{
 char act[1],top[1];
 scanf("%1s %1s",act,top);
 if(strcmp(act,top)==0){
 printf("H¥n");}else{
printf("D¥n");};
return0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'strcmp' was not declared in this scope
    7 |  if(strcmp(act,top)==0){
      |     ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<stdio.h>
  +++ |+#include <cstring>
    2 | 
a.cc:10:1: error: 'return0' was not declared in this scope
   10 | return0;
      | ^~~~~~~
Language: C++


#include <iostream>
using namespace std;
int main()
{
              int a,b;
              cin >> a >> b;
if (a = H)
	if(b=H)            {
                            cout  "H" << endl;
              }
        else {
                            cout  "D" << endl;
              }
else if (b=H) {
                            cout  "D" << endl;
              }
        else {
                            cout  "H" << endl;
              }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'H' was not declared in this scope
    8 | if (a = H)
      |         ^
a.cc:10:33: error: expected ';' before string constant
   10 |                             cout  "H" << endl;
      |                                 ^ ~~~
      |                                 ;
a.cc:13:33: error: expected ';' before string constant
   13 |                             cout  "D" << endl;
      |                                 ^ ~~~
      |                                 ;
a.cc:16:33: error: expected ';' before string constant
   16 |                             cout  "D" << endl;
      |                                 ^ ~~~
      |                                 ;
a.cc:19:33: error: expected ';' before string constant
   19 |                             cout  "H" << endl;
      |                                 ^ ~~~
      |                                 ;
Language: C++

import java.util.*;
 
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		char a = sc.next().charAt(0);
		char b = sc.next().charAt(0);
		if( (a=='H'&&b=='H')||(a=='D'&&b=='D') ){
			System.out.println("H");
		}else{
			System.out.println("D");
		}
		return;
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main{
      | ^~~~~~
Language: C

#include <stdio.h>

int main(void)
   {
       int a.b;
       printf ("A.Bは正直者？嘘つき？");
       scanf ("%d",&a,&b);

       if (a=H,b=H)
         printf ("H");
       else if (a=D,b=H)
         printf ("D");
       else if (a=H,b=D)
         printf ("D");
       else if (a=D,b=D)
         printf ("H")

       return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:5:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    5 |        int a.b;
      |             ^
main.c:5:13: error: expected expression before '.' token
main.c:7:21: error: 'a' undeclared (first use in this function)
    7 |        scanf ("%d",&a,&b);
      |                     ^
main.c:7:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:24: error: 'b' undeclared (first use in this function)
    7 |        scanf ("%d",&a,&b);
      |                        ^
main.c:9:14: error: 'H' undeclared (first use in this function)
    9 |        if (a=H,b=H)
      |              ^
main.c:11:19: error: 'D' undeclared (first use in this function)
   11 |        else if (a=D,b=H)
      |                   ^
main.c:16:22: error: expected ';' before 'return'
   16 |          printf ("H")
      |                      ^
      |                      ;
   17 | 
   18 |        return 0;
      |        ~~~~~~
Language: C

#include "stdafx.h"

void solve(char a, char b) {
	char ans;
	if (a == 'H') {
		ans = b;
	}
	else if (b == 'H'){
		ans = 'D';
	}
	else {
		ans = 'H';
	}

	printf("%c", ans);
}

int main()
{
	char a, b;
	scanf("%c %c", &a, &b);
	solve(a, b);
    return 0;
}


Compiler output:
main.c:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include "stdafx.h"

void solve(char a, char b) {
	char ans;
	if (a == 'H') {
		ans = b;
	}
	else if (b == 'H'){
		ans = 'D';
	}
	else {
		ans = 'H';
	}

	printf("%c", ans);
}

int main()
{
	char a, b;
	scanf("%c %c", &a, &b);
	solve(a, b);
    return 0;
}


Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#pragma once

#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;
string S[2],H,D;


int main() {
	
	H = "H";
	D = "D";

	cin >> S[0];
	cin >> S[1];

	if (S[0]==H) {
		if (S[1] == H) {
			cout << H.c_str << endl;
		}
		else {
			cout << D.c_str << endl;
		}
	}
	else {
		if (S[1] == H) {
			cout << D.c_str << endl;
		}
		else {
			cout << H.c_str << endl;
		}

	}


	return 0;
}




Compiler output:
a.cc:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
a.cc: In function 'int main()':
a.cc:23:30: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
   23 |                         cout << H.c_str << endl;
      |                         ~~~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:4:
/usr/include/c++/14/bits/basic_string.h:2640:7: note: declared here
 2640 |       c_str() const _GLIBCXX_NOEXCEPT
      |       ^~~~~
a.cc:26:30: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
   26 |                         cout << D.c_str << endl;
      |                         ~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:2640:7: note: declared here
 2640 |       c_str() const _GLIBCXX_NOEXCEPT
      |       ^~~~~
a.cc:31:30: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
   31 |                         cout << D.c_str << endl;
      |                         ~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:2640:7: note: declared here
 2640 |       c_str() const _GLIBCXX_NOEXCEPT
      |       ^~~~~
a.cc:34:30: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
   34 |                         cout << H.c_str << endl;
      |                         ~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:2640:7: note: declared here
 2640 |       c_str() const _GLIBCXX_NOEXCEPT
      |       ^~~~~
Language: C++

#include <stdio.h>  
  
int main()   
{  
   int a,b,H,D; 
scanf("a,b",&no);
if (a = H)
	if(b=H)
            puts("H");
        else
            puts("D");
else if (b=H)
	 puts("D");
        else
	puts("H");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: 'no' was not declared in this scope
    6 | scanf("a,b",&no);
      |              ^~
Language: Java

import java.util.Scanner;

public class HonestOrDishonest {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int a = s.next().equals("H") ? 0 : 1;
        int b = s.next().equals("H") ? 0 : 1;
        if (a + b == 1) {
            System.out.println("D");
        } else {
            System.out.println("H");
        }
    }
}

Compiler output:
Main.java:3: error: class HonestOrDishonest is public, should be declared in a file named HonestOrDishonest.java
public class HonestOrDishonest {
       ^
1 error
Language: C++

nclude <iostream>
#include <string.h>

using namespace std;

int main(){
  char a,b;
  scanf("%c %c",&a,&b);
  //cout << a << b << endl;

  if (a == b){
    cout << "H" << endl;
  }
  else{
    cout << "D" << endl;
  }
  return 0;

}


Compiler output:
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude <iostream>
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'scanf' was not declared in this scope
    8 |   scanf("%c %c",&a,&b);
      |   ^~~~~
a.cc:12:5: error: 'cout' was not declared in this scope
   12 |     cout << "H" << endl;
      |     ^~~~
a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <string.h>
  +++ |+#include <iostream>
    3 | 
a.cc:12:20: error: 'endl' was not declared in this scope
   12 |     cout << "H" << endl;
      |                    ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <string.h>
  +++ |+#include <ostream>
    3 | 
a.cc:15:5: error: 'cout' was not declared in this scope
   15 |     cout << "D" << endl;
      |     ^~~~
a.cc:15:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:20: error: 'endl' was not declared in this scope
   15 |     cout << "D" << endl;
      |                    ^~~~
a.cc:15:20: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

using System;

namespace A_HonestOrDishonest {
    class Program {
        static void Main(string[] args) {
            // スペース区切りの整数の入力
            string[] input = Console.ReadLine().Split(' ');
            string a = input[0];
            string b = input[1];
            string ans = (a == "H" && b == "H") || (a == "D" && b == "D")? "H": "D";
            Console.WriteLine(ans);
        }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:5:26: error: 'string' has not been declared
    5 |         static void Main(string[] args) {
      |                          ^~~~~~
a.cc:5:35: error: expected ',' or '...' before 'args'
    5 |         static void Main(string[] args) {
      |                                   ^~~~
a.cc:13:6: error: expected ';' after class definition
   13 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void A_HonestOrDishonest::Program::Main(int*)':
a.cc:7:13: error: 'string' was not declared in this scope
    7 |             string[] input = Console.ReadLine().Split(' ');
      |             ^~~~~~
a.cc:7:20: error: expected primary-expression before ']' token
    7 |             string[] input = Console.ReadLine().Split(' ');
      |                    ^
a.cc:8:20: error: expected ';' before 'a'
    8 |             string a = input[0];
      |                    ^
a.cc:9:20: error: expected ';' before 'b'
    9 |             string b = input[1];
      |                    ^
a.cc:10:20: error: expected ';' before 'ans'
   10 |             string ans = (a == "H" && b == "H") || (a == "D" && b == "D")? "H": "D";
      |                    ^~~
a.cc:11:13: error: 'Console' was not declared in this scope
   11 |             Console.WriteLine(ans);
      |             ^~~~~~~
a.cc:11:31: error: 'ans' was not declared in this scope
   11 |             Console.WriteLine(ans);
      |                               ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
	char a,b;
	std::cin>>a>>b;
  if(a==b){
	std::cout<<H;
  }else{
   std::cout<<D;
}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: 'H' was not declared in this scope
    7 |         std::cout<<H;
      |                    ^
a.cc:9:15: error: 'D' was not declared in this scope
    9 |    std::cout<<D;
      |               ^
Language: C++

if (a = H)
	if(b=H)
            puts("H");
        else
            puts("D");
else if (b=H)
	 puts("D");
        else
	puts("H");

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'if'
    1 | if (a = H)
      | ^~
a.cc:4:9: error: expected unqualified-id before 'else'
    4 |         else
      |         ^~~~
a.cc:6:1: error: expected unqualified-id before 'else'
    6 | else if (b=H)
      | ^~~~
a.cc:8:9: error: expected unqualified-id before 'else'
    8 |         else
      |         ^~~~
Language: C++

#include <iostream>
#include <cstdlib>
int main()
{
     int w, a, b;

     std::cin >> w;
     std::cin >> a;
     std::cin >> b;

     if(w > abs(a - b){
          std::cout << abs(b - a - w)) << std::endl;
     }
     else{
          std::cout << 0 << std::endl;
     }
     return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: expected ';' before '{' token
   11 |      if(w > abs(a - b){
      |                       ^
      |                       ;
a.cc:14:6: error: expected primary-expression before 'else'
   14 |      else{
      |      ^~~~
a.cc:13:7: error: expected ')' before 'else'
   13 |      }
      |       ^
      |       )
   14 |      else{
      |      ~~~~
a.cc:11:8: note: to match this '('
   11 |      if(w > abs(a - b){
      |        ^
Language: C++

#include <iostream>
#include <string>

using namespace std;


void main() {

	string a, b;

	cin >> a >> b;
	if ((a == "H"&&b == "H") || (a == "D"&&b == "D")) {
		cout << "H" << endl;
	}
	else {
		cout << "D" << endl;
	}

}

Compiler output:
a.cc:7:1: error: '::main' must return 'int'
    7 | void main() {
      | ^~~~
Language: C++

#include <iostream>
#include <cmath>
#include<cstdio>
#include<cstring>
using namespace std;

int main()
{
    char str[5],r;
    while(gets(str)!=NULL)
    {
      if(str[0]=='H')
        {
            if(str[2]=='H')
                r='H';
            else
                r='D';
        }
        else
        {
            if(str[2]=='H')
                r='D';
            else
                r='H';
        }
        printf("%c\n",r);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
   10 |     while(gets(str)!=NULL)
      |           ^~~~
      |           getw
Language: C++

#include <iostream>
using namespace std;

int main()
{
    char a,b;
    cin >> a >>b;
    bool boola = a == 'H';
    bool boolb = b == 'H';
    bool result = false;
    if(a && b) result = true;
    else if (a || b) result = false;
    else result = true;


    if(result)
    {
        return 'H';
    }
    else
    {
        return 'D';
    }
}


    if(result)
    {
        return 'H';
    }
    else
    {
        return 'D';
    }
}

Compiler output:
a.cc:27:5: error: expected unqualified-id before 'if'
   27 |     if(result)
      |     ^~
a.cc:31:5: error: expected unqualified-id before 'else'
   31 |     else
      |     ^~~~
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^
Language: C++

#include <iostream>
#include <cstdio>
#include <stdio.h>

using namespace std;

int main()
{
    char a[3];
    gets(a);
    if(a[0]=='H')
    {
        if(a[2]=='H') cout<<'H'<<endl;
        else cout<<'D'<<endl;
    }
    else if(a[0]=='D')
    {
        if(a[2]=='H') cout<<'D'<<endl;
        else cout<<'H'<<endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   10 |     gets(a);
      |     ^~~~
      |     getw
Language: C++

#include <iostream>
#include <string>
using namespace std;

string han(string A){
	if(A == "H"){
		return D;
	}
	else return H;
}

int main(){
	string A, B;
	cin >> A >> B;
	if (A == "H") cout << B << endl;
	else cout << han(B) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'std::string han(std::string)':
a.cc:7:24: error: 'D' was not declared in this scope
    7 |                 return D;
      |                        ^
a.cc:9:21: error: 'H' was not declared in this scope
    9 |         else return H;
      |                     ^
Language: C++

#include <iostream>
#include <cstdio>

using namespace std;

int main()
{
    char a[3];
    gets(a);
    if(a[0]=='H')
    {
        if(a[2]=='H') cout<<'H'<<endl;
        else cout<<'D'<<endl;
    }
    else if(a[0]=='D')
    {
        if(a[2]=='H') cout<<'D'<<endl;
        else cout<<'H'<<endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    9 |     gets(a);
      |     ^~~~
      |     getw
Language: C++



#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    char a,b;
    cin>>a>>b;
    int ans = 1;
    if (!strcmp(&b, "H")) ans = 1; else ans = -1;
    if (!strcmp(&a, "H")) ans *= 1; else ans *= -1;
    if (ans > 0) cout<<"H"<<endl; else cout<<"D"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: 'strcmp' was not declared in this scope
   13 |     if (!strcmp(&b, "H")) ans = 1; else ans = -1;
      |          ^~~~~~
a.cc:6:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <algorithm>
  +++ |+#include <cstring>
    6 | 
a.cc:14:10: error: 'strcmp' was not declared in this scope
   14 |     if (!strcmp(&a, "H")) ans *= 1; else ans *= -1;
      |          ^~~~~~
a.cc:14:10: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<stdio.h>
int main()
{
    char a[2];
    while(gets(a)!=NULL)
    {
        if(a[0]=='H')
            printf("%c\n",a[1]);
        else {
            if(a[1]=='H')
                printf("D\n");
            else printf("H\n");
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
    5 |     while(gets(a)!=NULL)
      |           ^~~~
      |           getw
Language: C++

#include <iostream>


int main() {
    char a,b;
    scanf("%c%c",&a,&b);
    if((a=='H' && b=='H') || (a=='D' && b=='D'){
        printf("H");
    }
    else{
        printf("D");
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:48: error: expected ';' before '{' token
    7 |     if((a=='H' && b=='H') || (a=='D' && b=='D'){
      |                                                ^
      |                                                ;
a.cc:10:5: error: expected primary-expression before 'else'
   10 |     else{
      |     ^~~~
a.cc:9:6: error: expected ')' before 'else'
    9 |     }
      |      ^
      |      )
   10 |     else{
      |     ~~~~
a.cc:7:7: note: to match this '('
    7 |     if((a=='H' && b=='H') || (a=='D' && b=='D'){
      |       ^
Language: C++


	if a =="H":
		if b=="H":
			return "H"
		else:
			return "D"
	else:
		if b=="H":
			return "D"
		else:
			return "H"

Compiler output:
a.cc:2:9: error: expected unqualified-id before 'if'
    2 |         if a =="H":
      |         ^~
Language: Java

import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char a = sc.next();
		char b = sc.next();
		if (a == 'H') {
			if (b == 'H') {
				System.out.println("H");
			} else {
				System.out.println("D");
			}
		} else {
			if (b == 'H') {
				System.out.println("D");
			} else {
				System.out.println("H");
			}
		}
	}
}

Compiler output:
Main.java:7: error: incompatible types: String cannot be converted to char
		char a = sc.next();
		                ^
Main.java:8: error: incompatible types: String cannot be converted to char
		char b = sc.next();
		                ^
2 errors
Language: C++

a, b = map(str, raw_input().split())
result = ''
if a == ‘H’:
	if b== ‘H’:
		result = ‘H’
	else:
		result = ‘D’
else:
	if b==‘H’
		result=‘D’
	else:
		result=‘H'

print result

Compiler output:
a.cc:2:10: error: empty character constant
    2 | result = ''
      |          ^~
a.cc:3:9: error: extended character ‘ is not valid in an identifier
    3 | if a == ‘H’:
      |         ^
a.cc:3:9: error: extended character ’ is not valid in an identifier
a.cc:4:16: error: extended character ‘ is not valid in an identifier
    4 |         if b== ‘H’:
      |                ^
a.cc:4:16: error: extended character ’ is not valid in an identifier
a.cc:5:26: error: extended character ‘ is not valid in an identifier
    5 |                 result = ‘H’
      |                          ^
a.cc:5:26: error: extended character ’ is not valid in an identifier
a.cc:7:26: error: extended character ‘ is not valid in an identifier
    7 |                 result = ‘D’
      |                          ^
a.cc:7:26: error: extended character ’ is not valid in an identifier
a.cc:9:15: error: extended character ‘ is not valid in an identifier
    9 |         if b==‘H’
      |               ^
a.cc:9:15: error: extended character ’ is not valid in an identifier
a.cc:10:24: error: extended character ‘ is not valid in an identifier
   10 |                 result=‘D’
      |                        ^
a.cc:10:24: error: extended character ’ is not valid in an identifier
a.cc:12:24: error: extended character ‘ is not valid in an identifier
   12 |                 result=‘H'
      |                        ^
a.cc:12:26: warning: missing terminating ' character
   12 |                 result=‘H'
      |                          ^
a.cc:12:26: error: missing terminating ' character
a.cc:1:1: error: 'a' does not name a type
    1 | a, b = map(str, raw_input().split())
      | ^
Language: C++

#include <cstdio>
using namespace std;
int main(){
      char a=getchar(),b=getchar(),getchar();
      putchar(a==b?'H’:'D');
}

Compiler output:
a.cc:5:20: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
    5 |       putchar(a==b?'H’:'D');
      |                    ^~~~~~
a.cc:5:26: warning: missing terminating ' character
    5 |       putchar(a==b?'H’:'D');
      |                          ^
a.cc:5:26: error: missing terminating ' character
    5 |       putchar(a==b?'H’:'D');
      |                          ^~~
a.cc: In function 'int main()':
a.cc:4:43: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
    4 |       char a=getchar(),b=getchar(),getchar();
      |                                           ^~
a.cc:4:43: note: remove parentheses to default-initialize a variable
    4 |       char a=getchar(),b=getchar(),getchar();
      |                                           ^~
      |                                           --
a.cc:4:43: note: or replace parentheses with braces to value-initialize a variable
a.cc: At global scope:
a.cc:4:36: error: ambiguating new declaration of 'char getchar()'
    4 |       char a=getchar(),b=getchar(),getchar();
      |                                    ^~~~~~~
In file included from /usr/include/c++/14/cstdio:42,
                 from a.cc:1:
/usr/include/stdio.h:582:12: note: old declaration 'int getchar()'
  582 | extern int getchar (void);
      |            ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:20: error: unable to find character literal operator 'operator""D' with 'int' argument
    5 |       putchar(a==b?'H’:'D');
      |                    ^~~~~~
a.cc:5:26: error: expected ':' before '}' token
    5 |       putchar(a==b?'H’:'D');
      |                          ^
      |                          :
    6 | }
      | ~                         
a.cc:6:1: error: expected primary-expression before '}' token
    6 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> iint;
typedef pair<ll,ll> llll;
#define ALL(x) (x).begin(),(x).end()
const ll zero = 0;
const ll one = 1;
const ll INF = 9223372036854775807; //10^18
const int inINF = 2147483647; //10^9
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int main(){
    int w, a, b;
    cin >> w >> a >> b;
    printf("%d\n", max(0, b-a-w+1, a-b-w+1));
}

Compiler output:
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:22:23:   required from here
   22 |     printf("%d\n", max(0, b-a-w+1, a-b-w+1));
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int W; int A; int B;
  cin>>W>>A>>B;
  int L=max(A,B)
  int R=min(A+W,B+W);
  if(R-L>=0)
    cout<<R-L<<endl;
  else cout<<0<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'int'
    7 |   int R=min(A+W,B+W);
      |   ^~~
a.cc:8:6: error: 'R' was not declared in this scope
    8 |   if(R-L>=0)
      |      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384


int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} 
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}    //最大公約数
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}     //最小公倍数
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} //コンビネーション
int nHr(int a,int b){return nCr(a+b-1,b);}       // 重複組み合わせ
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}  //階乗
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} // a~bまでの階乗
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}   //数字の各位の和
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}  // b進数の各位の和？
int sankaku(int x){return ((1+x)*x)/2;} //三角数 xまでの和

//以下long long ver
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}

//double
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}


typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;
 
/*CODE START HERE*/
int main() {
  int w, a,b;
  cin >> w >> a >> b;
  int c =  ads(b-a) - w
  cout << ( c> 0 ? c : 0) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:12: error: 'ads' was not declared in this scope; did you mean 'abs'?
   59 |   int c =  ads(b-a) - w
      |            ^~~
      |            abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int a, b, w, x, y, hasil;
 
int main () {
cin >> w >> a >> b;
if(a>b){
    y=b+w;
    if (y>b){
        cout << 0 << endl;
    }else{
    hasil=a-y;
    cout << hasil << endl;
}else if (b>a)
    x=a+w;
    if (x>a){
        cout << 0 << endl;
    }else{
    hasil=b-x;
    cout << hasil << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:2: error: expected '}' before 'else'
   15 | }else if (b>a)
      |  ^~~~
a.cc:8:8: note: to match this '{'
    8 | if(a>b){
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int a, b, w, x, y, hasil;
 
int main () {
cin >> a >> b >> w;
a+w=x;
hasil=b-x;
cout << hasil << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:2: error: lvalue required as left operand of assignment
    8 | a+w=x;
      | ~^~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int a, b, w;

int main () {
	cin >> a >> w >> b;
		if (w +a>=b) {
			cout<< (b+w<=a) <<endl;
		}
   			else {
   				cout<< 0 <<endl;	
			   }
			   		else {
			   			cout<< b-a-w <<endl;
					   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:41: error: 'else' without a previous 'if'
   14 |                                         else {
      |                                         ^~~~
Language: C++

using namespace std;

int W,a,b,FV,SV,zero;

int main() {
    cin>>W>>a>>b;
    zero=0;
    FV=b-(W+a);
    SV=a-(W+b);
    {if(FV>zero)
     cout<<FV<<endl;
     else if(SV>zero)
     cout<<SV<<endl;
     else
     cout<<zero<<endl;
    }
           }


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin>>W>>a>>b;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:11:6: error: 'cout' was not declared in this scope
   11 |      cout<<FV<<endl;
      |      ^~~~
a.cc:11:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:16: error: 'endl' was not declared in this scope
   11 |      cout<<FV<<endl;
      |                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:13:6: error: 'cout' was not declared in this scope
   13 |      cout<<SV<<endl;
      |      ^~~~
a.cc:13:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:16: error: 'endl' was not declared in this scope
   13 |      cout<<SV<<endl;
      |                ^~~~
a.cc:13:16: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:15:6: error: 'cout' was not declared in this scope
   15 |      cout<<zero<<endl;
      |      ^~~~
a.cc:15:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:18: error: 'endl' was not declared in this scope
   15 |      cout<<zero<<endl;
      |                  ^~~~
a.cc:15:18: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

using namespace std;

int W,a,b,FV,SV,zero;

int main() {
    zero=0;
    FV=b-(W+a);
    SV=a-(W+b);
    {if(FV>SV)
     cout<<FV<<endl;
     else if(FV<SV)
     cout<<SV<<endl;
     else
     cout<<zero<<endl;
    }
           }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: 'cout' was not declared in this scope
   10 |      cout<<FV<<endl;
      |      ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:10:16: error: 'endl' was not declared in this scope
   10 |      cout<<FV<<endl;
      |                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:12:6: error: 'cout' was not declared in this scope
   12 |      cout<<SV<<endl;
      |      ^~~~
a.cc:12:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:16: error: 'endl' was not declared in this scope
   12 |      cout<<SV<<endl;
      |                ^~~~
a.cc:12:16: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:14:6: error: 'cout' was not declared in this scope
   14 |      cout<<zero<<endl;
      |      ^~~~
a.cc:14:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:18: error: 'endl' was not declared in this scope
   14 |      cout<<zero<<endl;
      |                  ^~~~
a.cc:14:18: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  	int w, a, b;
	cin>>W>>a>>b;
	if(b<a)
		swap(a,b);
	if(b<=a+W)
		cout<<0<<endl;
	else
		cout<<(b-a-W)<<endl;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: 'W' was not declared in this scope
    6 |         cin>>W>>a>>b;
      |              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

#define pb push_back
#define mp make_pair
#define check cin >>
#define say cout <<
#define nicely << endl
#define initialize_playboy_mode ios_base::sync_with_stdio(0);
#define breakup_with_gf cin.tie(0);
#define messed_up cout << -1 << endl;
#define wife first
#define spare second

#define mgod main
#define wan 1

typedef int single;
typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;

class Riajuu
{
	public:
	
	vector<int> girls;
	int testcount=1;
	
	void hears(int &x)
	{
		cin>>x; 
	}
	void count_girls()
	{
		cin>>testcount;
	}
	bool stillRiajuu()
	{
		girls.clear();
		testcount--;
		if(testcount>=0) return true;
		else return false;
	}
	void remove_girls()
	{
		girls.clear();
	}
	void check_girls(int x){
		for(int i=0;i<x;i++){
			int j; cin >> j;
			girls.push_back(j);
		}
	}
} MGod;

void flirt() {
    single w,a,b; cin >> w >> a >> b;
    if(a>b) swap(a,b);
    cout << max(0,b-a-w);
    return
}

single mgod() {
    initialize_playboy_mode;
    breakup_with_gf;
    //MGod.count_girls();
    while(MGod.stillRiajuu()) flirt();
}


Compiler output:
a.cc: In function 'void flirt()':
a.cc:63:1: error: expected primary-expression before '}' token
   63 | }
      | ^
a.cc:62:11: error: expected ';' before '}' token
   62 |     return
      |           ^
      |           ;
   63 | }
      | ~
Language: Java

import java.util.Scanner;

public class main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a + w <= b)System.out.println(b - (a + w));
        else if(b + w <= a) System.out.println(a - (b + w));
        else System.out.println(0);
    }
}


Compiler output:
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
       ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c;
  cin>>a>>b>>;
  cout<<c-a*b<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: expected primary-expression before ';' token
    5 |   cin>>a>>b>>;
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using st=string;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(ll i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
st abc="abcdefghijklmnopqrstuvwxyz";
st ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
struct edge{ll to,cost;};

int main() {
  ll w,a,b;
  cin >> w >> a >> b;
  cout << max(b-a,max(abs(a+w-b),abs(b+w^a))+1)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:48: error: expected ';' before '}' token
   28 |   cout << max(b-a,max(abs(a+w-b),abs(b+w^a))+1)
      |                                                ^
      |                                                ;
   29 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  ll w, a, b;
  cin >> w >> a >> b;
  chmin(a, b);
  if (b <= a+w) cout << 0 << endl;
  else cout << abs(a+w-b) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'chmin' was not declared in this scope
   11 |   chmin(a, b);
      |   ^~~~~
Language: C++

def main():
  w,a,b = list(map(int,input().split()))
  if (a+w)<=b or b+w<=a:
    if abs(a+w-b)<=abs(b+w-a):
      print(abs(a+w-b))
    else:
      print(abs(b+w-a))
  else:
    print(0)
main()

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def main():
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int W,A,B;
  cin>>W>>A>>B;
  cout<<max(max(A,B)-(min(A,B)+w),0)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:32: error: 'w' was not declared in this scope
    7 |   cout<<max(max(A,B)-(min(A,B)+w),0)<<endl;
      |                                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int W,a,b;
  cin >> W >> a >> b;
  if (a<=B && b<=a+W) cout << 0 << endl;
  else if (a<=b+W && b+W<=a+W) cout << 0 << endl;
  else cout << max(b-a-W,a-b-W) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'B' was not declared in this scope
    7 |   if (a<=B && b<=a+W) cout << 0 << endl;
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define ll long long int
#define rep(i, n) for(int i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
using vi = vector<int>;
const int MOD = 1e9+7;

bool IsPrime(int num){
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2) { if (num % i == 0) return false; }
    return true;
}

int main() {
	int W,a,b;
  	cin >> W>>a>>b;
  	if(b<a+W&&b>a) cout << 0 << endl;
  	else if(b+W <a+W && b+W >a;) cout << 0 << endl;
  	else if(a==b)cout << 0 << endl;
  	else if(b >=　a+W) cout << b-a-W+1 <<endl;
  	else if(a >= b+W) cout << a-b+W+1<< endl;
  
  
}

Compiler output:
a.cc:25:21: error: extended character 　 is not valid in an identifier
   25 |         else if(b >=　a+W) cout << b-a-W+1 <<endl;
      |                     ^
a.cc: In function 'int main()':
a.cc:23:36: error: expected primary-expression before ')' token
   23 |         else if(b+W <a+W && b+W >a;) cout << 0 << endl;
      |                                    ^
a.cc:25:21: error: '\U00003000a' was not declared in this scope
   25 |         else if(b >=　a+W) cout << b-a-W+1 <<endl;
      |                     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define ALLR(v) v.rbegin(),v.rend()
typedef long long ll;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//isPrime
//modpow modinv
//getDigit
int main() {
  cout << fixed << setprecision(10);
  int w,a,b;
  cin >> w >> a >> b;
  if(a+w<b){
    cout << b-(a+w) << endl;
  }else if(b+w<a){
    cout << a-(b+w) << endl;
  }else{
    cout < 0 << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:14: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   24 |     cout < 0 << endl;
      |            ~~^~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <utility>
#include <map>
#include <climits>
#include <vector>
#include <set>
#include <string>
#include <numeric>

#define FAST_IO ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
#define int long long
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<pair<int, int>> vii;
const int N = 2 * (1e5 + 1);
const int INF = 1e9 + 5;
const long long MOD = 1e9 + 7;

int32_t main() {
    FAST_IO;
    int W, a, b;
    cin >> W >> a >> b;
    cout << max(abs(a-b)-W, 0);
    return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:27:16: error: no matching function for call to 'max(long long int, int)'
   27 |     cout << max(abs(a-b)-W, 0);
      |             ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:27:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   27 |     cout << max(abs(a-b)-W, 0);
      |             ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:27:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   27 |     cout << max(abs(a-b)-W, 0);
      |             ~~~^~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;


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

if(-min(b,c)-w+max(b,c) < 0){
	cout << 0 <<endl;
}
else{
	cout << -min(b,c)-w+max(b,c) <<endl;
}

}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: 'w' was not declared in this scope
    9 | if(-min(b,c)-w+max(b,c) < 0){
      |              ^