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

#include<iostream>
#include<string>
using namespace std;
int main{
  char a[10];
  int ans=0;
  for(int i=0;i<3;i++){
    cin>>a[i];
  }
  if(a[0]=='S'){
    if(a[2]=='N'){
      cout<<7;
    }else{
      cout<<1;
    }
    else if(a[0]=='M'){
      cout<<6;
    }else if(a[0]=='W'){
      cout<<4;
    }else if(a[0]=='F'){
      cout<<2;
    }else if(a[1]=='U'){
      cout<<5;
    }else{
      cout<<3;
    }
  }

Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main{
      |     ^~~~
a.cc:5:3: error: expected primary-expression before 'char'
    5 |   char a[10];
      |   ^~~~
a.cc:5:3: error: expected '}' before 'char'
a.cc:4:9: note: to match this '{'
    4 | int main{
      |         ^
a.cc:7:3: error: expected unqualified-id before 'for'
    7 |   for(int i=0;i<3;i++){
      |   ^~~
a.cc:7:15: error: 'i' does not name a type
    7 |   for(int i=0;i<3;i++){
      |               ^
a.cc:7:19: error: 'i' does not name a type
    7 |   for(int i=0;i<3;i++){
      |                   ^
a.cc:10:3: error: expected unqualified-id before 'if'
   10 |   if(a[0]=='S'){
      |   ^~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main{
  string a;
  int ans=0;
  cin>>a;
  if(a[0]=='S'){
    if(a[2]=='N'){
      cout<<7;
    }else{
      cout<<1;
    }
    else if(a[0]=='M'){
      cout<<6;
    }else if(a[0]=='W'){
      cout<<4;
    }else if(a[0]=='F'){
      cout<<2;
    }else if(a[1]=='U'){
      cout<<5;
    }else{
      cout<<3;
    }
  }

Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main{
      |     ^~~~
a.cc:5:10: error: expected primary-expression before 'a'
    5 |   string a;
      |          ^
a.cc:5:10: error: expected '}' before 'a'
a.cc:4:9: note: to match this '{'
    4 | int main{
      |         ^
a.cc:7:3: error: 'cin' does not name a type
    7 |   cin>>a;
      |   ^~~
a.cc:8:3: error: expected unqualified-id before 'if'
    8 |   if(a[0]=='S'){
      |   ^~
Language: Java

import java.util.Scanner;
public class A_Holiday {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String s= sc.next();
		String[] bruh =  {"SUN","MON","TUE","WED","THU","FRI","SAT"};
		for (int i = 0 ; i < 7 ; i ++ )
			if (s.equals(bruh[i]))
			{
				System.out.println(7-i);
			}
	}

}


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

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

int main(){
    string SUN,MON,TUE,WED,THU,FRI,SAT;
    string S;

    cin >> S;

    if(S=SUN){
        cout << "7" << endl;
    }
    else if(S=MON){
        cout << "6" << endl;
    }
    else if(S=TUE){
        cout << "5" << endl;
    }
    else if(S=WED){
        cout << "4" << endl;
    }
    else if(S=THU){
        cout << "3" << endl;
    }
    else if(S=FRI){
        cout << "2" << endl;
    }
    else {
        cout << "1" << endl; 
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: could not convert 'S.std::__cxx11::basic_string<char>::operator=(SUN)' from 'std::__cxx11::basic_string<char>' to 'bool'
   11 |     if(S=SUN){
      |        ~^~~~
      |         |
      |         std::__cxx11::basic_string<char>
a.cc:14:14: error: could not convert 'S.std::__cxx11::basic_string<char>::operator=(MON)' from 'std::__cxx11::basic_string<char>' to 'bool'
   14 |     else if(S=MON){
      |             ~^~~~
      |              |
      |              std::__cxx11::basic_string<char>
a.cc:17:14: error: could not convert 'S.std::__cxx11::basic_string<char>::operator=(TUE)' from 'std::__cxx11::basic_string<char>' to 'bool'
   17 |     else if(S=TUE){
      |             ~^~~~
      |              |
      |              std::__cxx11::basic_string<char>
a.cc:20:14: error: could not convert 'S.std::__cxx11::basic_string<char>::operator=(WED)' from 'std::__cxx11::basic_string<char>' to 'bool'
   20 |     else if(S=WED){
      |             ~^~~~
      |              |
      |              std::__cxx11::basic_string<char>
a.cc:23:14: error: could not convert 'S.std::__cxx11::basic_string<char>::operator=(THU)' from 'std::__cxx11::basic_string<char>' to 'bool'
   23 |     else if(S=THU){
      |             ~^~~~
      |              |
      |              std::__cxx11::basic_string<char>
a.cc:26:14: error: could not convert 'S.std::__cxx11::basic_string<char>::operator=(FRI)' from 'std::__cxx11::basic_string<char>' to 'bool'
   26 |     else if(S=FRI){
      |             ~^~~~
      |              |
      |              std::__cxx11::basic_string<char>
Language: C++

int day, S;

#include<bits/stdc++.h>
using namespace std;
int main() {
	int day, S;
	cin >> day;
	int SUN, MON, TUE, WED, THU, FRI, SAT;
	S = 7;
	SUN == 0, MON == 1, TUE == 2, WED == 3, THU == 4, FRI == 5, SAT == 6;
nt main() {
	int  S;
	if (S = 0) cout << 7 << endl;
	else if (S = 1)cout << 6 << endl;
	else if (S = 2)cout << 5 << endl;
	else if (S = 3)cout << 4 << endl;
	else if (S = 4)cout << 3 << endl;
	else if (S = 5)cout << 2 << endl;
	else if (S = 6)cout << 1 << endl;
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:1: error: 'nt' was not declared in this scope; did you mean 'int'?
   11 | nt main() {
      | ^~
      | int
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

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

int main(){
    string SUN,MON,TUE,WED,THU,FRI,SAT;

    cin >> S;

    if(S=SUN){
        cout << "7" << endl;
    }
    else if(S=MON){
        cout << "6" << endl;
    }
    else if(S=TUE){
        cout << "5" << endl;
    }
    else if(S=WED){
        cout << "4" << endl;
    }
    else if(S=THU){
        cout << "3" << endl;
    }
    else if(S=FRI){
        cout << "2" << endl;
    }
    else {
        cout << "1" << endl; 
    }
    return 0;
}

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

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

int main(){
    string S =SUN,MON,TUE,WED,THU,FRI,SAT;

    cin >> S;
    
    if(S=SUN){
        cout << "7" << endl;
    }
    else if(S=MON){
        cout << "6" << endl;
    }
    else if(S=TUE){
        cout << "5" << endl;
    }
    else if(S=WED){
        cout << "4" << endl;
    }
    else if(S=THU){
        cout << "3" << endl;
    }
    else if(S=FRI){
        cout << "2" << endl;
    }
    else {
        cout << "1" << endl; 
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: 'SUN' was not declared in this scope
    6 |     string S =SUN,MON,TUE,WED,THU,FRI,SAT;
      |               ^~~
a.cc:13:15: error: 'MON' was not declared in this scope
   13 |     else if(S=MON){
      |               ^~~
a.cc:16:15: error: 'TUE' was not declared in this scope
   16 |     else if(S=TUE){
      |               ^~~
a.cc:19:15: error: 'WED' was not declared in this scope
   19 |     else if(S=WED){
      |               ^~~
a.cc:22:15: error: 'THU' was not declared in this scope
   22 |     else if(S=THU){
      |               ^~~
a.cc:25:15: error: 'FRI' was not declared in this scope
   25 |     else if(S=FRI){
      |               ^~~
Language: C++

#include<stdio.h>
int main()
{
    char a[4];
    gets (a);
    if(strcmp(a,"SUN")==0)
    printf("7");
    else if(strcmp(a,"MON")==0)
    printf("6");
      else if(strcmp(a,"TUE")==0)
    printf("5");
        else if(strcmp(a,"WED")==0)
    printf("4");
        else if(strcmp(a,"THU")==0)
    printf("3");
       else if(strcmp(a,"FRI")==0)
    printf("2");
        else if(strcmp(a,"SAT")==0)
    printf("1");
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    5 |     gets (a);
      |     ^~~~
      |     getw
a.cc:6:8: error: 'strcmp' was not declared in this scope
    6 |     if(strcmp(a,"SUN")==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 | int main()
Language: Java

import java.util.*;

public class Main {
  static final String weeks = "SUNSATFRITHUWEDTUEMON";
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    int index = weeks.indexOf(str);
    if(index > 0){
      index = (indexe) / 3;
    }else {
      index = 7;
    }
    System.out.println(String.valueOf(index));
  }
}

Compiler output:
Main.java:10: error: cannot find symbol
      index = (indexe) / 3;
               ^
  symbol:   variable indexe
  location: class Main
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    string s;
    cin>>s;
    switch(s){
        case "SUN":cout<<7;break;
        case "SAT":cout<<1;break;
        case "FRI":cout<<2;break;
        case "THU":cout<<3;break;
        case "WED":cout<<4;break;
        case "TUE":cout<<5;break;
        case "MON":cout<<6;break;
        
    }
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: switch quantity not an integer
   10 |     switch(s){
      |            ^
Language: Java

import java.util.Scanner;

public class a{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        String s = scan.next();

        String[] str = new String[7];
        str[0] = "SAT"; 
        str[1] = "FRI";
        str[2] = "THU";
        str[3] = "WED";
        str[4] = "TUE";
        str[5] = "MON";
        str[6] = "SUN";

        for(int i = 1; i <= 7; i++){
            if(s.equals(str[i - 1])){
                System.out.println(i + " ");
                break;
            }
        }
    }
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;

if (S == ‘SUN’){
    cout << 7 << endl;
 }
if (S == ‘MON’){
    cout << 6 << endl;
 }
if (S == ‘TUE’){
    cout << 5 << endl;
 }
if (S == ‘WED’){
    cout << 4 << endl;
 }
if (S == ‘THU’){
    cout << 3 << endl;
 }
if (S == ‘FRI’){
    cout << 2 << endl;
 }
if (S == ‘SAT’){
    cout << 1 << endl;
  }
}


Compiler output:
a.cc:8:10: error: extended character ‘ is not valid in an identifier
    8 | if (S == ‘SUN’){
      |          ^
a.cc:8:10: error: extended character ’ is not valid in an identifier
a.cc:11:10: error: extended character ‘ is not valid in an identifier
   11 | if (S == ‘MON’){
      |          ^
a.cc:11:10: error: extended character ’ is not valid in an identifier
a.cc:14:10: error: extended character ‘ is not valid in an identifier
   14 | if (S == ‘TUE’){
      |          ^
a.cc:14:10: error: extended character ’ is not valid in an identifier
a.cc:17:10: error: extended character ‘ is not valid in an identifier
   17 | if (S == ‘WED’){
      |          ^
a.cc:17:10: error: extended character ’ is not valid in an identifier
a.cc:20:10: error: extended character ‘ is not valid in an identifier
   20 | if (S == ‘THU’){
      |          ^
a.cc:20:10: error: extended character ’ is not valid in an identifier
a.cc:23:10: error: extended character ‘ is not valid in an identifier
   23 | if (S == ‘FRI’){
      |          ^
a.cc:23:10: error: extended character ’ is not valid in an identifier
a.cc:26:10: error: extended character ‘ is not valid in an identifier
   26 | if (S == ‘SAT’){
      |          ^
a.cc:26:10: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:10: error: '\U00002018SUN\U00002019' was not declared in this scope
    8 | if (S == ‘SUN’){
      |          ^~~~~
a.cc:11:10: error: '\U00002018MON\U00002019' was not declared in this scope
   11 | if (S == ‘MON’){
      |          ^~~~~
a.cc:14:10: error: '\U00002018TUE\U00002019' was not declared in this scope
   14 | if (S == ‘TUE’){
      |          ^~~~~
a.cc:17:10: error: '\U00002018WED\U00002019' was not declared in this scope
   17 | if (S == ‘WED’){
      |          ^~~~~
a.cc:20:10: error: '\U00002018THU\U00002019' was not declared in this scope
   20 | if (S == ‘THU’){
      |          ^~~~~
a.cc:23:10: error: '\U00002018FRI\U00002019' was not declared in this scope
   23 | if (S == ‘FRI’){
      |          ^~~~~
a.cc:26:10: error: '\U00002018SAT\U00002019' was not declared in this scope
   26 | if (S == ‘SAT’){
      |          ^~~~~
Language: C++

#define rep(i, n) for (int i=0; i < (int)(n); i++)
#include <bits/stdc++.h>
#include <math.h>
using namespace std;



int main() {
  string s;
  cin >> s;
  
  map<string, int> mp = {
    {"SUN": 7}, 
    {"MON": 6},
    {"TUE": 5},
    {"WED": 4},
    {"THU": 3},
    {"FRI": 2},
    {"SAT": 1}
  };
  
  auto begin = mp.begin(), end = mp.end();
  for(auto itr = begin(); itr != end; itr++){
    if(itr.at(0) == s){
      count << itr.at(1);
      break;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: expected '}' before ':' token
   13 |     {"SUN": 7},
      |     ~     ^
a.cc:13:11: error: expected '}' before ':' token
a.cc:12:25: note: to match this '{'
   12 |   map<string, int> mp = {
      |                         ^
a.cc:13:11: error: could not convert '{{"SUN"}}' from '<brace-enclosed initializer list>' to 'std::map<std::__cxx11::basic_string<char>, int>'
   13 |     {"SUN": 7},
      |           ^
      |           |
      |           <brace-enclosed initializer list>
a.cc:13:11: error: expected ',' or ';' before ':' token
a.cc: At global scope:
a.cc:13:15: error: mixing declarations and function-definitions is forbidden
   13 |     {"SUN": 7},
      |               ^
a.cc:14:5: error: expected unqualified-id before '{' token
   14 |     {"MON": 6},
      |     ^
a.cc:14:15: error: expected unqualified-id before ',' token
   14 |     {"MON": 6},
      |               ^
a.cc:15:5: error: expected unqualified-id before '{' token
   15 |     {"TUE": 5},
      |     ^
a.cc:15:15: error: expected unqualified-id before ',' token
   15 |     {"TUE": 5},
      |               ^
a.cc:16:5: error: expected unqualified-id before '{' token
   16 |     {"WED": 4},
      |     ^
a.cc:16:15: error: expected unqualified-id before ',' token
   16 |     {"WED": 4},
      |               ^
a.cc:17:5: error: expected unqualified-id before '{' token
   17 |     {"THU": 3},
      |     ^
a.cc:17:15: error: expected unqualified-id before ',' token
   17 |     {"THU": 3},
      |               ^
a.cc:18:5: error: expected unqualified-id before '{' token
   18 |     {"FRI": 2},
      |     ^
a.cc:18:15: error: expected unqualified-id before ',' token
   18 |     {"FRI": 2},
      |               ^
a.cc:19:5: error: expected unqualified-id before '{' token
   19 |     {"SAT": 1}
      |     ^
a.cc:20:3: error: expected declaration before '}' token
   20 |   };
      |   ^
a.cc:22:16: error: 'mp' was not declared in this scope
   22 |   auto begin = mp.begin(), end = mp.end();
      |                ^~
a.cc:23:3: error: expected unqualified-id before 'for'
   23 |   for(auto itr = begin(); itr != end; itr++){
      |   ^~~
a.cc:23:27: error: 'itr' does not name a type
   23 |   for(auto itr = begin(); itr != end; itr++){
      |                           ^~~
a.cc:23:39: error: 'itr' does not name a type
   23 |   for(auto itr = begin(); itr != end; itr++){
      |                                       ^~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: Java

import java.util.*;

public class Main {
  static final String weeks = "SUNSATFRITHUWEDTUEMON";
  public static void main(String args[]){
    Sccaner sc = new Scanner(System.in);
    String str = sc.next();
    int index = weeks.indexOf(str);
    if(index > 0){
      index = index / 3;
    }
    System.out.println(String.valueOf(index));
  }
}

Compiler output:
Main.java:6: error: cannot find symbol
    Sccaner sc = new Scanner(System.in);
    ^
  symbol:   class Sccaner
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main {
  static final String weeks = "SUNSATFRITHUWEDTUEMON";
  public static void main(String args[]){
    Scaner sc = new Scanner(System.in);
    String str = sc.next();
    int index = weeks.indexOf(str);
    if(index > 0){
      index = index / 3;
    }
    System.out.println(String.valueOf(index));
  }
}

Compiler output:
Main.java:6: error: cannot find symbol
    Scaner sc = new Scanner(System.in);
    ^
  symbol:   class Scaner
  location: class Main
1 error
Language: C

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

int main() {
  
  string a;
  cin >> a;
  
  if (a=="SUN"){
    cout << 7 << endl;
  }
  else if (a=="MON"){
    cout << 6 << endl;
  }
  else if (a=="TUE"){
    cout << 5 << endl;
  }
  else if (a=="WED"){
    cout << 4 << endl;
  }
  else if (a=="THU"){
    cout << 3 << endl;
  }
  else if (a=="FRI"){
    cout << 2 << endl;
  }
  else {
    cout << 1 << endl;
  }
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>

char str[3];
scanf("%s",str);
 
if(str[0] = 'S'){
 if(str[1] = 'A'){
   printf('1');
 }
 else if(str[1] = 'U'){
     printf('7');
 }
}
else if(str[0] = 'M'){
  printf('6');
}
else if(str[0] = 'T'){
  if(str[1] = 'U'){
    printf('5');
  }
  else if(str[1] = 'H'){
    printf('3');
  }
}
else if(str[0] = 'W'){
  printf('4');
}
else if(str[0] = 'F'){
  printf('2');
}
 
  return 0;
}

Compiler output:
main.c:4:7: error: expected declaration specifiers or '...' before string constant
    4 | scanf("%s",str);
      |       ^~~~
main.c:4:12: error: expected declaration specifiers or '...' before 'str'
    4 | scanf("%s",str);
      |            ^~~
main.c:6:1: error: expected identifier or '(' before 'if'
    6 | if(str[0] = 'S'){
      | ^~
main.c:14:1: error: expected identifier or '(' before 'else'
   14 | else if(str[0] = 'M'){
      | ^~~~
main.c:17:1: error: expected identifier or '(' before 'else'
   17 | else if(str[0] = 'T'){
      | ^~~~
main.c:25:1: error: expected identifier or '(' before 'else'
   25 | else if(str[0] = 'W'){
      | ^~~~
main.c:28:1: error: expected identifier or '(' before 'else'
   28 | else if(str[0] = 'F'){
      | ^~~~
main.c:32:3: error: expected identifier or '(' before 'return'
   32 |   return 0;
      |   ^~~~~~
main.c:33:1: error: expected identifier or '(' before '}' token
   33 | }
      | ^
Language: C++

#include <stdio.h>

int main(void) {
	char day[4];
	scanf("%s", day);
	
		if(day == 'SUN') 
		{ 
			printf("%d", 7); 
		}
	    if (day == 'MON')
		{
			printf("%d", 6);
		}
		if (day == 'TUE')
		{
			printf("%d", 5);
		}
		if (day == 'WED')
		{
			printf("%d", 4);
		}
		if (day == 'THU')
		{
			printf("%d", 3);
		}
		if (day == 'FRI')
		{
			printf("%d", 2);
		}
		if (day == 'SAT')
		{
			printf("%d", 1);
		}
		return 0:
}


Compiler output:
a.cc:7:27: warning: multi-character character constant [-Wmultichar]
    7 |                 if(day == 'SUN')
      |                           ^~~~~
a.cc:11:24: warning: multi-character character constant [-Wmultichar]
   11 |             if (day == 'MON')
      |                        ^~~~~
a.cc:15:28: warning: multi-character character constant [-Wmultichar]
   15 |                 if (day == 'TUE')
      |                            ^~~~~
a.cc:19:28: warning: multi-character character constant [-Wmultichar]
   19 |                 if (day == 'WED')
      |                            ^~~~~
a.cc:23:28: warning: multi-character character constant [-Wmultichar]
   23 |                 if (day == 'THU')
      |                            ^~~~~
a.cc:27:28: warning: multi-character character constant [-Wmultichar]
   27 |                 if (day == 'FRI')
      |                            ^~~~~
a.cc:31:28: warning: multi-character character constant [-Wmultichar]
   31 |                 if (day == 'SAT')
      |                            ^~~~~
a.cc: In function 'int main()':
a.cc:7:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |                 if(day == 'SUN')
      |                    ~~~~^~~~~~~~
a.cc:11:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |             if (day == 'MON')
      |                 ~~~~^~~~~~~~
a.cc:15:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |                 if (day == 'TUE')
      |                     ~~~~^~~~~~~~
a.cc:19:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |                 if (day == 'WED')
      |                     ~~~~^~~~~~~~
a.cc:23:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |                 if (day == 'THU')
      |                     ~~~~^~~~~~~~
a.cc:27:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   27 |                 if (day == 'FRI')
      |                     ~~~~^~~~~~~~
a.cc:31:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   31 |                 if (day == 'SAT')
      |                     ~~~~^~~~~~~~
a.cc:35:25: error: expected ';' before ':' token
   35 |                 return 0:
      |                         ^
      |                         ;
a.cc:35:25: error: expected primary-expression before ':' token
Language: Java

import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
//		int x = scan.nextInt();
		String s = scan.nextLine();
		int ans = 0;
		switch(s) {
		case "SUN":ans = 7;
		break;
		case "SUT":ans = 1;
		break;
		case "FRI":ans = 2;
		break;
		case "THU":ans = 3;
		break;
		case "WED":ans = 4;
		break;
		case "TUE":ans = 5;
		break;
		case "MON":ans = 6;
		break;
		}
		System.out.println(ans);
	}
}
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.nextLine();
		int ans = 0;
		switch(s) {
		case "SUN":ans = 7;
		break;
		case "SAT":ans = 1;
		break;
		case "FRI":ans = 2;
		break;
		case "THU":ans = 3;
		break;
		case "WED":ans = 4;
		break;
		case "TUE":ans = 5;
		break;
		case "MON":ans = 6;
		break;
		}
		System.out.println(ans);
	}
}

Compiler output:
Main.java:27: error: class, interface, enum, or record expected
import java.util.Scanner;
^
1 error
Language: C

char str[3];
scanf("%s",str);

if(str[0] = 'S'){
 if(str[1] = 'A'){
   printf('1');
 }
 else if(str[1] = 'U'){
     printf('7');
 }
}
else if(str[0] = 'M'){
  printf('6');
}
else if(str[0] = 'T'){
  if(str[1] = 'U'){
    printf('5');
  }
  else if(str[1] = 'H'){
    printf('3');
  }
}
else if(str[0] = 'W'){
  printf('4');
}
else if(str[0] = 'F'){
  printf('2');
}

  return 0;
}


Compiler output:
main.c:2:7: error: expected declaration specifiers or '...' before string constant
    2 | scanf("%s",str);
      |       ^~~~
main.c:2:12: error: expected declaration specifiers or '...' before 'str'
    2 | scanf("%s",str);
      |            ^~~
main.c:4:1: error: expected identifier or '(' before 'if'
    4 | if(str[0] = 'S'){
      | ^~
main.c:12:1: error: expected identifier or '(' before 'else'
   12 | else if(str[0] = 'M'){
      | ^~~~
main.c:15:1: error: expected identifier or '(' before 'else'
   15 | else if(str[0] = 'T'){
      | ^~~~
main.c:23:1: error: expected identifier or '(' before 'else'
   23 | else if(str[0] = 'W'){
      | ^~~~
main.c:26:1: error: expected identifier or '(' before 'else'
   26 | else if(str[0] = 'F'){
      | ^~~~
main.c:30:3: error: expected identifier or '(' before 'return'
   30 |   return 0;
      |   ^~~~~~
main.c:31:1: error: expected identifier or '(' before '}' token
   31 | }
      | ^
Language: C++

#include<iostream>
#include<math.h>

using namespace std;

int GetDigit(int num){
    int digit = 0;
    return log10(num) + 1;
    }

    return digit;
}
int main(){
    int A,B,X;
    cin >> A;
    cin >> B;
    cin >> X;

    int i = 1;
    while(X > A*GetDigit(i) + B*i){
        i++;
    }
    cout << i;

    return 0;
}

Compiler output:
a.cc:11:5: error: expected unqualified-id before 'return'
   11 |     return digit;
      |     ^~~~~~
a.cc:12:1: error: expected declaration before '}' token
   12 | }
      | ^
Language: C++

#include <stdio.h>

int main(void) {
	char day[2];
	scanf("%s", day);
	
		if(day == 'SUN') 
		{ 
			printf("%d", 7); 
		}
	    if (day == 'MON')
		{
			printf("%d", 6);
		}
		if (day == 'TUE')
		{
			printf("%d", 5);
		}
		if (day == 'WED')
		{
			printf("%d", 4);
		}
		if (day == 'THU')
		{
			printf("%d", 3);
		}
		if (day == 'FRI')
		{
			printf("%d", 2);
		}
		if (day == 'SAT')
		{
			printf("%d", 1);
		}
		return 0:
}


Compiler output:
a.cc:7:27: warning: multi-character character constant [-Wmultichar]
    7 |                 if(day == 'SUN')
      |                           ^~~~~
a.cc:11:24: warning: multi-character character constant [-Wmultichar]
   11 |             if (day == 'MON')
      |                        ^~~~~
a.cc:15:28: warning: multi-character character constant [-Wmultichar]
   15 |                 if (day == 'TUE')
      |                            ^~~~~
a.cc:19:28: warning: multi-character character constant [-Wmultichar]
   19 |                 if (day == 'WED')
      |                            ^~~~~
a.cc:23:28: warning: multi-character character constant [-Wmultichar]
   23 |                 if (day == 'THU')
      |                            ^~~~~
a.cc:27:28: warning: multi-character character constant [-Wmultichar]
   27 |                 if (day == 'FRI')
      |                            ^~~~~
a.cc:31:28: warning: multi-character character constant [-Wmultichar]
   31 |                 if (day == 'SAT')
      |                            ^~~~~
a.cc: In function 'int main()':
a.cc:7:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |                 if(day == 'SUN')
      |                    ~~~~^~~~~~~~
a.cc:11:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |             if (day == 'MON')
      |                 ~~~~^~~~~~~~
a.cc:15:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |                 if (day == 'TUE')
      |                     ~~~~^~~~~~~~
a.cc:19:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |                 if (day == 'WED')
      |                     ~~~~^~~~~~~~
a.cc:23:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |                 if (day == 'THU')
      |                     ~~~~^~~~~~~~
a.cc:27:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   27 |                 if (day == 'FRI')
      |                     ~~~~^~~~~~~~
a.cc:31:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   31 |                 if (day == 'SAT')
      |                     ~~~~^~~~~~~~
a.cc:35:25: error: expected ';' before ':' token
   35 |                 return 0:
      |                         ^
      |                         ;
a.cc:35:25: error: expected primary-expression before ':' token
Language: C++

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

int main() {
  int A,B,X;
  cin >> A >> B >> X;
  
  for(int N =0; i<1000000000; i++){
    int iN = N ;
    int d; while(iN != 0){iN = iN/10}
    
    if(X < A*N + B*d){
      cout << N-1 << endl;
      break;
    }
    
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'i' was not declared in this scope
    8 |   for(int N =0; i<1000000000; i++){
      |                 ^
a.cc:10:37: error: expected ';' before '}' token
   10 |     int d; while(iN != 0){iN = iN/10}
      |                                     ^
      |                                     ;
Language: C++

#include <stdio.h>

int main() {
	char day[2];
	scanf("%s", day);
	
		if(day == 'SUN') 
		{ 
			printf("%d", 7); 
		}
	    if (day == 'MON')
		{
			printf("%d", 6);
		}
		if (day == 'TUE')
		{
			printf("%d", 5);
		}
		if (day == 'WED')
		{
			printf("%d", 4);
		}
		if (day == 'THU')
		{
			printf("%d", 3);
		}
		if (day == 'FRI')
		{
			printf("%d", 2);
		}
		if (day == 'SAT')
		{
			printf("%d", 1);
		}
		return 0:
}


Compiler output:
a.cc:7:27: warning: multi-character character constant [-Wmultichar]
    7 |                 if(day == 'SUN')
      |                           ^~~~~
a.cc:11:24: warning: multi-character character constant [-Wmultichar]
   11 |             if (day == 'MON')
      |                        ^~~~~
a.cc:15:28: warning: multi-character character constant [-Wmultichar]
   15 |                 if (day == 'TUE')
      |                            ^~~~~
a.cc:19:28: warning: multi-character character constant [-Wmultichar]
   19 |                 if (day == 'WED')
      |                            ^~~~~
a.cc:23:28: warning: multi-character character constant [-Wmultichar]
   23 |                 if (day == 'THU')
      |                            ^~~~~
a.cc:27:28: warning: multi-character character constant [-Wmultichar]
   27 |                 if (day == 'FRI')
      |                            ^~~~~
a.cc:31:28: warning: multi-character character constant [-Wmultichar]
   31 |                 if (day == 'SAT')
      |                            ^~~~~
a.cc: In function 'int main()':
a.cc:7:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |                 if(day == 'SUN')
      |                    ~~~~^~~~~~~~
a.cc:11:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |             if (day == 'MON')
      |                 ~~~~^~~~~~~~
a.cc:15:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |                 if (day == 'TUE')
      |                     ~~~~^~~~~~~~
a.cc:19:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |                 if (day == 'WED')
      |                     ~~~~^~~~~~~~
a.cc:23:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |                 if (day == 'THU')
      |                     ~~~~^~~~~~~~
a.cc:27:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   27 |                 if (day == 'FRI')
      |                     ~~~~^~~~~~~~
a.cc:31:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   31 |                 if (day == 'SAT')
      |                     ~~~~^~~~~~~~
a.cc:35:25: error: expected ';' before ':' token
   35 |                 return 0:
      |                         ^
      |                         ;
a.cc:35:25: error: expected primary-expression before ':' token
Language: C++

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

int main()
{
  long A,B,N;
  cin>>A>>B>>N;
  long max=1000000000;
  long ans=0;
  long sum=0;
  int num;
  for(i=1;i<=max;i++){
    num=i;
    for(int j=0;j<=10;j++){
      sum+=num%10;
      num/=10;
    }
    if(A*i+B*sum<=N)ans=i;
    sum=0;
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   for(i=1;i<=max;i++){
      |       ^
Language: C++

#include<bits/sdc++.h>
using namespace std;
int main(){
   string f;
  cin>>f;
   if(f=="MON")
      cout<<"6";
  else if(f=="TUE")
     cout<<"5";
  else if(f=="WED")
      cout<<"4";
  else if(f=="THU")
     cout<<"3";
   else if(f=="FRI")
      cout<<"2";
   else if(f=="SAT")
      cout<<"1";
  else
     cout<<"7";
  return 0;
}

Compiler output:
a.cc:1:9: fatal error: bits/sdc++.h: No such file or directory
    1 | #include<bits/sdc++.h>
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main() {
  long long a, b, c;
  cin >> a >> b >> c;
  for (int i = c/a; i>0; i++){
    if (i+float(b)/float(a)*int(std::log10(i))<=float(c)/float(a)){
      cout << i << endl;
      break;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:38: error: 'log10' is not a member of 'std'
    9 |     if (i+float(b)/float(a)*int(std::log10(i))<=float(c)/float(a)){
      |                                      ^~~~~
Language: Java

import java.util.*;
import static java.lang.System.*;

public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String Alphabet[] = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
int N = sc.nextInt();
String S = sc.next();
String ans ="";
for(int i=0;i<(S.length);i++){
	for(int j=0;j<28;j++){
    if((S.charAt(i)).equals(Alphabet[j])){
    ans = ans+Alphabet[j+N];
    }
	}
out.println(ans);
}

}
}


Compiler output:
Main.java:11: error: cannot find symbol
for(int i=0;i<(S.length);i++){
                ^
  symbol:   variable length
  location: variable S of type String
Main.java:13: error: char cannot be dereferenced
    if((S.charAt(i)).equals(Alphabet[j])){
                    ^
2 errors
Language: C++

#include <stdio.h>

int main() {
	char day[3];
	scanf("%s", day);
	
		if(day == 'SUN') 
		{ printf("%d", 7); 
		}
	    if (day == 'MON')
		{
			printf("%d", 6);
		}
		if (day == 'TUE')
		{
			printf("%d", 5);
		}
		if (day == 'WED')
		{
			printf("%d", 4);
		}
		if (day == 'THU')
		{
			printf("%d", 3);
		}
		if (day == 'FRI')
		{
			printf("%d", 2);
		}
		if (day == 'SAT')
		{
			printf("%d", 1);
		}
}


Compiler output:
a.cc:7:27: warning: multi-character character constant [-Wmultichar]
    7 |                 if(day == 'SUN')
      |                           ^~~~~
a.cc:10:24: warning: multi-character character constant [-Wmultichar]
   10 |             if (day == 'MON')
      |                        ^~~~~
a.cc:14:28: warning: multi-character character constant [-Wmultichar]
   14 |                 if (day == 'TUE')
      |                            ^~~~~
a.cc:18:28: warning: multi-character character constant [-Wmultichar]
   18 |                 if (day == 'WED')
      |                            ^~~~~
a.cc:22:28: warning: multi-character character constant [-Wmultichar]
   22 |                 if (day == 'THU')
      |                            ^~~~~
a.cc:26:28: warning: multi-character character constant [-Wmultichar]
   26 |                 if (day == 'FRI')
      |                            ^~~~~
a.cc:30:28: warning: multi-character character constant [-Wmultichar]
   30 |                 if (day == 'SAT')
      |                            ^~~~~
a.cc: In function 'int main()':
a.cc:7:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |                 if(day == 'SUN')
      |                    ~~~~^~~~~~~~
a.cc:10:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |             if (day == 'MON')
      |                 ~~~~^~~~~~~~
a.cc:14:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |                 if (day == 'TUE')
      |                     ~~~~^~~~~~~~
a.cc:18:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |                 if (day == 'WED')
      |                     ~~~~^~~~~~~~
a.cc:22:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |                 if (day == 'THU')
      |                     ~~~~^~~~~~~~
a.cc:26:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |                 if (day == 'FRI')
      |                     ~~~~^~~~~~~~
a.cc:30:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   30 |                 if (day == 'SAT')
      |                     ~~~~^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;

if (S == “SUN”){
    cout << 7 << endl;
 }
if (S == “MON”){
    cout << 6 << endl;
 }
if (S == “TUE”){
    cout << 5 << endl;
 }
if (S == “WED”){
    cout << 4 << endl;
 }
if (S == “THU”){
    cout << 3 << endl;
 }
if (S == “FRI”){
    cout << 2 << endl;
 }
if (S == “SAT”){
    cout << 1 << endl;
  }
}


Compiler output:
a.cc:8:10: error: extended character “ is not valid in an identifier
    8 | if (S == “SUN”){
      |          ^
a.cc:8:10: error: extended character ” is not valid in an identifier
a.cc:11:10: error: extended character “ is not valid in an identifier
   11 | if (S == “MON”){
      |          ^
a.cc:11:10: error: extended character ” is not valid in an identifier
a.cc:14:10: error: extended character “ is not valid in an identifier
   14 | if (S == “TUE”){
      |          ^
a.cc:14:10: error: extended character ” is not valid in an identifier
a.cc:17:10: error: extended character “ is not valid in an identifier
   17 | if (S == “WED”){
      |          ^
a.cc:17:10: error: extended character ” is not valid in an identifier
a.cc:20:10: error: extended character “ is not valid in an identifier
   20 | if (S == “THU”){
      |          ^
a.cc:20:10: error: extended character ” is not valid in an identifier
a.cc:23:10: error: extended character “ is not valid in an identifier
   23 | if (S == “FRI”){
      |          ^
a.cc:23:10: error: extended character ” is not valid in an identifier
a.cc:26:10: error: extended character “ is not valid in an identifier
   26 | if (S == “SAT”){
      |          ^
a.cc:26:10: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:10: error: '\U0000201cSUN\U0000201d' was not declared in this scope
    8 | if (S == “SUN”){
      |          ^~~~~
a.cc:11:10: error: '\U0000201cMON\U0000201d' was not declared in this scope
   11 | if (S == “MON”){
      |          ^~~~~
a.cc:14:10: error: '\U0000201cTUE\U0000201d' was not declared in this scope
   14 | if (S == “TUE”){
      |          ^~~~~
a.cc:17:10: error: '\U0000201cWED\U0000201d' was not declared in this scope
   17 | if (S == “WED”){
      |          ^~~~~
a.cc:20:10: error: '\U0000201cTHU\U0000201d' was not declared in this scope
   20 | if (S == “THU”){
      |          ^~~~~
a.cc:23:10: error: '\U0000201cFRI\U0000201d' was not declared in this scope
   23 | if (S == “FRI”){
      |          ^~~~~
a.cc:26:10: error: '\U0000201cSAT\U0000201d' was not declared in this scope
   26 | if (S == “SAT”){
      |          ^~~~~
Language: C++

nclude <stdio.h>

int main(null){
  int n,i,j,minval;
  int s[8]={'SUN','MON','TUE','WED','THU','FRI','SAT',\0};

  scanf("%",&n);

  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }

  for(j=1;j<=n;j++){
    for(i=1;i<=n;i++){
      printf("%d ",a[i-1]);
      if(i==5)
        printf("\n");
    }
  }
}


Compiler output:
a.cc:5:13: warning: multi-character character constant [-Wmultichar]
    5 |   int s[8]={'SUN','MON','TUE','WED','THU','FRI','SAT',\0};
      |             ^~~~~
a.cc:5:19: warning: multi-character character constant [-Wmultichar]
    5 |   int s[8]={'SUN','MON','TUE','WED','THU','FRI','SAT',\0};
      |                   ^~~~~
a.cc:5:25: warning: multi-character character constant [-Wmultichar]
    5 |   int s[8]={'SUN','MON','TUE','WED','THU','FRI','SAT',\0};
      |                         ^~~~~
a.cc:5:31: warning: multi-character character constant [-Wmultichar]
    5 |   int s[8]={'SUN','MON','TUE','WED','THU','FRI','SAT',\0};
      |                               ^~~~~
a.cc:5:37: warning: multi-character character constant [-Wmultichar]
    5 |   int s[8]={'SUN','MON','TUE','WED','THU','FRI','SAT',\0};
      |                                     ^~~~~
a.cc:5:43: warning: multi-character character constant [-Wmultichar]
    5 |   int s[8]={'SUN','MON','TUE','WED','THU','FRI','SAT',\0};
      |                                           ^~~~~
a.cc:5:49: warning: multi-character character constant [-Wmultichar]
    5 |   int s[8]={'SUN','MON','TUE','WED','THU','FRI','SAT',\0};
      |                                                 ^~~~~
a.cc:5:55: error: stray '\' in program
    5 |   int s[8]={'SUN','MON','TUE','WED','THU','FRI','SAT',\0};
      |                                                       ^
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude <stdio.h>
      | ^~~~~~
Language: C

#include<stdio.h>
#include<string.h>
main()
{
  char S[5];
  scanf("%s",S);
  char s[7][5]={"SAT","FRI","THU","WED","TUE","MON","SUN"};
  int x,num;
  x=0; num=0;
  for(x=0;x<7;x++){
    if(S==s[x]){
      num=x+1
  printf("%d",num);}
  }
}
  


Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main()
      | ^~~~
main.c: In function 'main':
main.c:12:14: error: expected ';' before 'printf'
   12 |       num=x+1
      |              ^
      |              ;
   13 |   printf("%d",num);}
      |   ~~~~~~
Language: C++

#include<iostream.h>
#include<string.h>
#niclude<stdio.h>

int main(void)
{
  string s;
  cin >> s;
  
  switch(s){
    case SUN:
      printf("%d",7);
      break;
	case MON:
      printf("%d",6);
      break;
	case TUE:
      printf("%d",5);
      break;
	case WED:
      printf("%d",4);
      break;
	case THU:
      printf("%d",3);
      break;
	case FRI:
      printf("%d",2);
      break;
	case SAT:
      printf("%d",1);
      break;
  }
  
  return 0;
}

Compiler output:
a.cc:1:9: fatal error: iostream.h: No such file or directory
    1 | #include<iostream.h>
      |         ^~~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<string.h>
main()
{
  char S[5];
  scanf("%s",S);
  s[7][5]={"SAT","FRI","THU","WED","TUE","MON","SUN"};
  int x,num;
  x=0; num=0;
  for(x=0;x<7;x++){
    if(S==s[x]){
      num=x+1
  printf("%d",num);}
    
}
  


Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main()
      | ^~~~
main.c: In function 'main':
main.c:7:3: error: 's' undeclared (first use in this function)
    7 |   s[7][5]={"SAT","FRI","THU","WED","TUE","MON","SUN"};
      |   ^
main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:11: error: expected expression before '{' token
    7 |   s[7][5]={"SAT","FRI","THU","WED","TUE","MON","SUN"};
      |           ^
main.c:12:14: error: expected ';' before 'printf'
   12 |       num=x+1
      |              ^
      |              ;
   13 |   printf("%d",num);}
      |   ~~~~~~      
main.c:15:1: error: expected declaration or statement at end of input
   15 | }
      | ^
Language: C++

#include<iostream.h>
#include<string.h>

int main(void)
{
  string s;
  cin >> s;
  
  switch(s){
    case SUN:
      printf("%d",7);
      break;
	case MON:
      printf("%d",6);
      break;
	case TUE:
      printf("%d",5);
      break;
	case WED:
      printf("%d",4);
      break;
	case THU:
      printf("%d",3);
      break;
	case FRI:
      printf("%d",2);
      break;
	case SAT:
      printf("%d",1);
      break;
  }
  
  return 0;
}

Compiler output:
a.cc:1:9: fatal error: iostream.h: No such file or directory
    1 | #include<iostream.h>
      |         ^~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
import static java.lang.System.*;

public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
char Alpha[] = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
int N = sc.nextInt();
String S = sc.next();
String ans ="";
for(int i=0;i<(S.length);i++){
	for(int j=0;j<28;j++){
    if((S.charAt(i)).equals(Alpha[j])){
    ans = ans+Alpha[j+N];
    }
	}
out.println(ans);
}

}
}


Compiler output:
Main.java:7: error: illegal start of expression
char Alpha[] = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
               ^
1 error
Language: C++

#include<bits/stdc++.h>
#define QS ios_base::sync_with_stdio(false);
typedef unsigned long long ll;
const ll INF = 1e18;
const int MOD = 1e9+7;
const int N = 1e9;
using namespace std;

ll a, b, x, res;
ll ck(ll num){
    ll tmp = num, cnt = 0;
    while(tmp){
        tmp/=10;
        cnt++;
    }
    ll need = a*num + cnt*b;
    return need;
}

int main(){
//freopen("output.txt", "w", stdout);
    QS

    cin >> a >> b >> x;
    ll lo = 1, hi = N, mid = -1;

    while(lo < hi){
        mid = (lo + hi)/2;
        ll need = ck(mid);
        if(need > x){
            hi = mid;
        }
        else{
            res = max(res, mid);
            lo = mid;
        }
        if(lo + 1 == hi) break;
    }
    for(ll i = max(mid-1); i <= mid + 1;++i){
        ll need = ck(i);
        if(x >= need){
            res = max(res, i);
        }
    }
    cout << res << '\n';
}



Compiler output:
a.cc: In function 'int main()':
a.cc:39:19: error: no matching function for call to 'max(ll)'
   39 |     for(ll i = max(mid-1); i <= mid + 1;++i){
      |                ~~~^~~~~~~
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: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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/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:   template argument deduction/substitution failed:
a.cc:39:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long unsigned int'
   39 |     for(ll i = max(mid-1); i <= mid + 1;++i){
      |                ~~~^~~~~~~
/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:   candidate expects 2 arguments, 1 provided
Language: C++

#include<iostream>
#include <string>
using namespace std;
int main()
{
  string S;
  int d;
  cin >> S;
  
  if (S == "MON") {
    s = 6;
    }else if (S == "TUE") {
    s = 5;
    }else if (S == "WED") {
    s = 4;
    }else if (S == "THU") {
    s = 3;
    }else if (S == "FRI") {
    s = 2;
    }else if (S == "SAT") {
    s = 1;
    }else if (S == "SUN") {
    s = 7;
    }else{
    s = -1;
    }
  cout << s << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 's' was not declared in this scope
   11 |     s = 6;
      |     ^
a.cc:13:5: error: 's' was not declared in this scope
   13 |     s = 5;
      |     ^
a.cc:15:5: error: 's' was not declared in this scope
   15 |     s = 4;
      |     ^
a.cc:17:5: error: 's' was not declared in this scope
   17 |     s = 3;
      |     ^
a.cc:19:5: error: 's' was not declared in this scope
   19 |     s = 2;
      |     ^
a.cc:21:5: error: 's' was not declared in this scope
   21 |     s = 1;
      |     ^
a.cc:23:5: error: 's' was not declared in this scope
   23 |     s = 7;
      |     ^
a.cc:25:5: error: 's' was not declared in this scope
   25 |     s = -1;
      |     ^
a.cc:27:11: error: 's' was not declared in this scope
   27 |   cout << s << endl;
      |           ^