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

#include <string>
#include <iostream>
#include <unordered_map>

int main() {
	string day;
	cin >> day;
	unordered_map<string, int> dayMap {{"MON", 1}, {"TUE", 2}, {"WED", 3}, {"THU", 4}, {"FRI", 5}, {"SAT", 6}, {"SUN", 7}};
  	return 7 - dayMap[day];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'string' was not declared in this scope
    6 |         string day;
      |         ^~~~~~
a.cc:6:9: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin >> day;
      |         ^~~
      |         std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:16: error: 'day' was not declared in this scope
    7 |         cin >> day;
      |                ^~~
a.cc:8:9: error: 'unordered_map' was not declared in this scope
    8 |         unordered_map<string, int> dayMap {{"MON", 1}, {"TUE", 2}, {"WED", 3}, {"THU", 4}, {"FRI", 5}, {"SAT", 6}, {"SUN", 7}};
      |         ^~~~~~~~~~~~~
a.cc:8:9: note: suggested alternatives:
In file included from /usr/include/c++/14/unordered_map:41,
                 from a.cc:3:
/usr/include/c++/14/bits/unordered_map.h:109:11: note:   'std::unordered_map'
  109 |     class unordered_map
      |           ^~~~~~~~~~~~~
/usr/include/c++/14/unordered_map:67:13: note:   'std::pmr::unordered_map'
   67 |       using unordered_map
      |             ^~~~~~~~~~~~~
a.cc:8:31: error: expected primary-expression before 'int'
    8 |         unordered_map<string, int> dayMap {{"MON", 1}, {"TUE", 2}, {"WED", 3}, {"THU", 4}, {"FRI", 5}, {"SAT", 6}, {"SUN", 7}};
      |                               ^~~
a.cc:9:20: error: 'dayMap' was not declared in this scope
    9 |         return 7 - dayMap[day];
      |                    ^~~~~~
Language: Java

public class Main{
   public static void main(String[] args){
     switch (args[0]) {
       case "SUN":
           System.out.println("7");
       case "MON":
           System.out.println("6");
       case "TUE":
           System.out.println("5");
       case "WED":
           System.out.println("4");
       case "THU":
           System.out.println("3");
       case "FRI":
           System.out.println("2");
       case "SAT":
           System.out.println("1");
     }
     return 0;
   }
}

Compiler output:
Main.java:19: error: incompatible types: unexpected return value
     return 0;
            ^
1 error
Language: Java

public class Main{
   public static void main(String[] args){
     switch (args[0]) {
         case:"SUN"
           System.out.println("7");
         case:"MON"
           System.out.println("6");
         case:"TUE"
           System.out.println("5");
         case:"WED"
           System.out.println("4");
         case:"THU"
           System.out.println("3");
         case:"FRI"
           System.out.println("2");
         case:"SAT"
           System.out.println("1");
     }
     return 0;
   }
}

Compiler output:
Main.java:4: error: illegal start of expression
         case:"SUN"
             ^
Main.java:4: error: not a statement
         case:"SUN"
              ^
Main.java:4: error: ';' expected
         case:"SUN"
                   ^
Main.java:6: error: illegal start of expression
         case:"MON"
             ^
Main.java:6: error: not a statement
         case:"MON"
              ^
Main.java:6: error: ';' expected
         case:"MON"
                   ^
Main.java:8: error: illegal start of expression
         case:"TUE"
             ^
Main.java:8: error: not a statement
         case:"TUE"
              ^
Main.java:8: error: ';' expected
         case:"TUE"
                   ^
Main.java:10: error: illegal start of expression
         case:"WED"
             ^
Main.java:10: error: not a statement
         case:"WED"
              ^
Main.java:10: error: ';' expected
         case:"WED"
                   ^
Main.java:12: error: illegal start of expression
         case:"THU"
             ^
Main.java:12: error: not a statement
         case:"THU"
              ^
Main.java:12: error: ';' expected
         case:"THU"
                   ^
Main.java:14: error: illegal start of expression
         case:"FRI"
             ^
Main.java:14: error: not a statement
         case:"FRI"
              ^
Main.java:14: error: ';' expected
         case:"FRI"
                   ^
Main.java:16: error: illegal start of expression
         case:"SAT"
             ^
Main.java:16: error: not a statement
         case:"SAT"
              ^
Main.java:16: error: ';' expected
         case:"SAT"
                   ^
21 errors
Language: C

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

//Function Macros:
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define all(v) (v).begin(), (v).end()
#define setpre(n) cout << fixed << setprecision(n)

//Type Definitions:
typedef long long ll;
typedef unsigned long long ull;

//Constants:
const int INF = 2e9;
const int MOD = 1e9 + 7;

//Global Variables:

//Prototype Declarations:
int gcd(int, int);

//================ Main Loop ================
int main() {
    string s;
    cin >> s;
    int ans;
    if(s == "MON") ans = 6;
    if(s == "TUE") ans = 5;
    if(s == "WED") ans = 4;
    if(s == "THU") ans = 3;
    if(s == "FRI") ans = 2;
    if(s == "SAT") ans = 1;
    if(s == "SUN") ans = 7;
    cout << ans << endl;
    return 0;
}
//===========================================

//Functions:
int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}

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

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'SUN' was not declared in this scope
    7 |   if(a==SUN)cout << "7"<<endl;
      |         ^~~
a.cc:8:9: error: 'MON' was not declared in this scope
    8 |   if(a==MON)cout << "6"<<endl;
      |         ^~~
a.cc:9:9: error: 'TUE' was not declared in this scope
    9 |   if(a==TUE)cout << "5"<<endl;
      |         ^~~
a.cc:10:9: error: 'WED' was not declared in this scope
   10 |   if(a==WED)cout << "4"<<endl;
      |         ^~~
a.cc:11:9: error: 'THU' was not declared in this scope
   11 |   if(a==THU)cout << "3"<<endl;
      |         ^~~
a.cc:12:9: error: 'FRI' was not declared in this scope
   12 |   if(a==FRI)cout << "2"<<endl;
      |         ^~~
a.cc:13:9: error: 'SAT' was not declared in this scope
   13 |   if(a==SAT)cout << "1"<<endl;
      |         ^~~
Language: C++

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

int main() {
  string S;
  map<string, int> M;
  M["MON"] = 6;
   M["TUE"] = 5;
    M["WED"] = 4;
    M["THU"] = 3;
    M["FRI"] = 2;
    M["SAT"] = 1;
    M["SUN"] = 7;
  cin >> S;
  cout << M[S] << endl;
}

Compiler output:
a.cc:4:20: error: expected ';' before 'int'
    4 | using namespace std
      |                    ^
      |                    ;
    5 | 
    6 | int main() {
      | ~~~
Language: C++

#include<iostream>
#include<map>
#include<string>

int main() {
  string S;
  map<string, int> M;
  M["MON"] = 6;
   M["TUE"] = 5;
    M["WED"] = 4;
    M["THU"] = 3;
    M["FRI"] = 2;
    M["SAT"] = 1;
    M["SUN"] = 7;
  cin >> S;
  cout << M[S] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string S;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included 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:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:3: error: 'map' was not declared in this scope
    7 |   map<string, int> M;
      |   ^~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/map:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_map.h:102:11: note:   'std::map'
  102 |     class map
      |           ^~~
/usr/include/c++/14/map:89:13: note:   'std::pmr::map'
   89 |       using map
      |             ^~~
a.cc:7:15: error: expected primary-expression before 'int'
    7 |   map<string, int> M;
      |               ^~~
a.cc:8:3: error: 'M' was not declared in this scope
    8 |   M["MON"] = 6;
      |   ^
a.cc:15:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   15 |   cin >> S;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:15:10: error: 'S' was not declared in this scope
   15 |   cin >> S;
      |          ^
a.cc:16:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |   cout << M[S] << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |   cout << M[S] << endl;
      |                   ^~~~
      |                   std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

function pi(d){
  return parseInt(d,10);
}
function main(n) {
  const d=n.split(' ');
  var a;
  switch(d){
    case "SAT": a=1;break;
    case "FRI": a=2;break;
    case "THU":a=3;break;
    case "WED":a=4;break;
    case "TUE":a=5;break;
    case "MON":a=6;break;
    default:a=7;
  }
  console.log(a);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Compiler output:
a.cc:18:14: warning: multi-character character constant [-Wmultichar]
   18 | main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |              ^~~~
a.cc:18:33: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
   18 | main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |                                 ^~~~~~~~~~~~
a.cc:18:47: warning: multi-character character constant [-Wmultichar]
   18 | main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |                                               ^~~~~~
a.cc:1:1: error: 'function' does not name a type; did you mean 'union'?
    1 | function pi(d){
      | ^~~~~~~~
      | union
a.cc:4:1: error: 'function' does not name a type; did you mean 'union'?
    4 | function main(n) {
      | ^~~~~~~~
      | union
a.cc:18:5: error: expected constructor, destructor, or type conversion before '(' token
   18 | main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |     ^
Language: C++

s=input()
if s == "MON":
  print(6)
elif s == "TUE":
  print(5)
elif s == "WED":
  print(4)
elif s == "THU":
  print(3)
elif s == "FRI":
  print(2)
elif s == "SAT":
  print(1)
else:
  print(7)

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s=input()
      | ^
Language: C++

function pi(d){
  return parseInt(d,10);
}
function main(n) {
  var a;
  switch(n){
    case 'SAT': a=1;break;
    case 'FRI': a=2;break;
    case 'THU':a=3;break;
    case 'WED':a=4;break;
    case 'TUE':a=5;break;
    case 'MON':a=6;break;
    default:a=7;
  }
  console.log(a);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Compiler output:
a.cc:7:10: warning: multi-character character constant [-Wmultichar]
    7 |     case 'SAT': a=1;break;
      |          ^~~~~
a.cc:8:10: warning: multi-character character constant [-Wmultichar]
    8 |     case 'FRI': a=2;break;
      |          ^~~~~
a.cc:9:10: warning: multi-character character constant [-Wmultichar]
    9 |     case 'THU':a=3;break;
      |          ^~~~~
a.cc:10:10: warning: multi-character character constant [-Wmultichar]
   10 |     case 'WED':a=4;break;
      |          ^~~~~
a.cc:11:10: warning: multi-character character constant [-Wmultichar]
   11 |     case 'TUE':a=5;break;
      |          ^~~~~
a.cc:12:10: warning: multi-character character constant [-Wmultichar]
   12 |     case 'MON':a=6;break;
      |          ^~~~~
a.cc:17:14: warning: multi-character character constant [-Wmultichar]
   17 | main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |              ^~~~
a.cc:17:33: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
   17 | main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |                                 ^~~~~~~~~~~~
a.cc:17:47: warning: multi-character character constant [-Wmultichar]
   17 | main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |                                               ^~~~~~
a.cc:1:1: error: 'function' does not name a type; did you mean 'union'?
    1 | function pi(d){
      | ^~~~~~~~
      | union
a.cc:4:1: error: 'function' does not name a type; did you mean 'union'?
    4 | function main(n) {
      | ^~~~~~~~
      | union
a.cc:17:5: error: expected constructor, destructor, or type conversion before '(' token
   17 | main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  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;
}
 


Compiler output:
a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: switch quantity not an integer
    7 |   switch(S){
      |          ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected ',' or ';' before 'cin'
    8 |     cin>>day;
      |     ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i <(n) ; ++i)
#define PI 3.14159265
using namespace std;
using ll = long long;
void self_max(int &a,int b){
	a = max(a,b);
}
void self_min(ll &a,ll b){
	a = min(a,b);
}

int main(){
	vector<string> con = ["MON", "TUE", "WED", "THU", "FRI","SAT","SUN","MON", "TUE", "WED", "THU", "FRI","SAT","SUN"];
	string s; cin >> s;
	int cur;
	rep(i,con.size()){
		if(con[i] == s){
			cur = i;
			break;
		}
	}

	int ans = 0;
	for(int i= cur; i<con.size();i++){
		if(con[i] != "SUN"){
			ans++;
		}else{
			break;
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: expected identifier before string constant
   14 |         vector<string> con = ["MON", "TUE", "WED", "THU", "FRI","SAT","SUN","MON", "TUE", "WED", "THU", "FRI","SAT","SUN"];
      |                               ^~~~~
a.cc:14:36: error: expected ']' before ',' token
   14 |         vector<string> con = ["MON", "TUE", "WED", "THU", "FRI","SAT","SUN","MON", "TUE", "WED", "THU", "FRI","SAT","SUN"];
      |                                    ^
      |                                    ]
a.cc: In lambda function:
a.cc:14:36: error: expected '{' before ',' token
a.cc: In function 'int main()':
a.cc:14:30: error: conversion from 'main()::<lambda()>' to non-scalar type 'std::vector<std::__cxx11::basic_string<char> >' requested
   14 |         vector<string> con = ["MON", "TUE", "WED", "THU", "FRI","SAT","SUN","MON", "TUE", "WED", "THU", "FRI","SAT","SUN"];
      |                              ^~~~~~
a.cc:14:38: error: expected unqualified-id before string constant
   14 |         vector<string> con = ["MON", "TUE", "WED", "THU", "FRI","SAT","SUN","MON", "TUE", "WED", "THU", "FRI","SAT","SUN"];
      |                                      ^~~~~
Language: Java

importt java.util.Scanner;
public class Mian{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int SUN=7,MON=6,TUE=5,WED=4,THU=3,FRI=2,SAT=1;
    input = sc.Scanner;
    System.out.print(input);
    sc.close();
  }
}
    

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

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

ll a,b,x;
long long sum(long long n){
  ll logn = log10l((long double)n);
  ll s = a*n + b*(logn + 1);
  return s;
}
  
int main(){
  cin >> a >> b >> x;
  if(sum(1000000000) < x)cout << 1000000000 <<endl;
  else{
  ll min = 0;
  ll max = x;
  while(min != max && max - 1 != min){
    ll r = (min + max)/2;
    if(sum(r) > x)max = r;
    else min = r;
  }
  cout << min << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:13:11: note: to match this '{'
   13 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <string>
#include <map>
#include "test.h"

using namespace std;

int main()
{
	string sToday;
	string sDays[8] = { "","SAT","FRI","THU","WED","TUE","MON","SUN" };

	cin >> sToday;

	for (int i = 1; i < 8; i++) {
		if (sToday == sDays[i]) {
			cout << i << endl;
			break;
		}
	}

	return 0;
}

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

#include <iostream>
using namespace std;
int main(){
  string s;
  cin >> s;
  switch (s) {
    case "SUN":
      cout << 7 << endl;
      break;
    case "MON":
      cout << 6 << endl;
      break;
    case "TUE":
      cout << 5 << endl;
      break;
    case "WED":
      cout << 4 << endl;
      break;
    case "THU":
      cout << 3 << endl;
      break;
    case "FRI":
      cout << 2 << endl;
      break;
    default:
      cout << 1 << endl;
      break;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: switch quantity not an integer
    6 |   switch (s) {
      |           ^
Language: C++

#include <iostream>
using namespace std;
int main(){
  char s[3];
  cin >> s;
  switch (s) {
    case "SUN":
      cout << 7 << endl;
      break;
    case "MON":
      cout << 6 << endl;
      break;
    case "TUE":
      cout << 5 << endl;
      break;
    case "WED":
      cout << 4 << endl;
      break;
    case "THU":
      cout << 3 << endl;
      break;
    case "FRI":
      cout << 2 << endl;
      break;
    default:
      cout << 1 << endl;
      break;
  }
}

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

import java.util.Scanner;

public class Main {
  private String day[]={"SUN","MON","TUE","WED","THU","FRI","SAT"};
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      String s=sc.next();
      for(int i=0;i<7;i++){
        if(day[i]==s)
          System.out.println(7-i);
      }
      
    }
}

Compiler output:
Main.java:9: error: non-static variable day cannot be referenced from a static context
        if(day[i]==s)
           ^
1 error
Language: C++

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

int main() {
	char str[10];

	cin >> str;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: 'strcmp' was not declared in this scope
   12 |         if (strcmp(str, "SUN") == 0) {
      |             ^~~~~~
a.cc:4:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | #include <string>
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	map<String, int> m;
  	m["SUN"] = 7;
  	m["MON"] = 6;
  	m["TUE"] = 5;
  	m["WED"] = 4;
    m["THU"] = 3;
  	m["FRI"] = 2;
  	m["SAT"] = 1;
  	string temp;
  	cin >> temp;
  	cout << m[temp];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:13: error: 'String' was not declared in this scope
    4 |         map<String, int> m;
      |             ^~~~~~
a.cc:4:24: error: template argument 1 is invalid
    4 |         map<String, int> m;
      |                        ^
a.cc:4:24: error: template argument 3 is invalid
a.cc:4:24: error: template argument 4 is invalid
a.cc:5:18: error: assignment of read-only location '"SUN"[m]'
    5 |         m["SUN"] = 7;
      |         ~~~~~~~~~^~~
a.cc:6:18: error: assignment of read-only location '"MON"[m]'
    6 |         m["MON"] = 6;
      |         ~~~~~~~~~^~~
a.cc:7:18: error: assignment of read-only location '"TUE"[m]'
    7 |         m["TUE"] = 5;
      |         ~~~~~~~~~^~~
a.cc:8:18: error: assignment of read-only location '"WED"[m]'
    8 |         m["WED"] = 4;
      |         ~~~~~~~~~^~~
a.cc:9:14: error: assignment of read-only location '"THU"[m]'
    9 |     m["THU"] = 3;
      |     ~~~~~~~~~^~~
a.cc:10:18: error: assignment of read-only location '"FRI"[m]'
   10 |         m["FRI"] = 2;
      |         ~~~~~~~~~^~~
a.cc:11:18: error: assignment of read-only location '"SAT"[m]'
   11 |         m["SAT"] = 1;
      |         ~~~~~~~~~^~~
a.cc:14:18: error: no match for 'operator[]' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   14 |         cout << m[temp];
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	map<String, int> m{};
  	m["SUN"] = 7;
  	m["MON"] = 6;
  	m["TUE"] = 5;
  	m["WED"] = 4;
    m["THU"] = 3;
  	m["FRI"] = 2;
  	m["SAT"] = 1;
  	string temp;
  	cin >> temp;
  	cout << m[temp];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:13: error: 'String' was not declared in this scope
    4 |         map<String, int> m{};
      |             ^~~~~~
a.cc:4:24: error: template argument 1 is invalid
    4 |         map<String, int> m{};
      |                        ^
a.cc:4:24: error: template argument 3 is invalid
a.cc:4:24: error: template argument 4 is invalid
a.cc:5:18: error: assignment of read-only location '"SUN"[m]'
    5 |         m["SUN"] = 7;
      |         ~~~~~~~~~^~~
a.cc:6:18: error: assignment of read-only location '"MON"[m]'
    6 |         m["MON"] = 6;
      |         ~~~~~~~~~^~~
a.cc:7:18: error: assignment of read-only location '"TUE"[m]'
    7 |         m["TUE"] = 5;
      |         ~~~~~~~~~^~~
a.cc:8:18: error: assignment of read-only location '"WED"[m]'
    8 |         m["WED"] = 4;
      |         ~~~~~~~~~^~~
a.cc:9:14: error: assignment of read-only location '"THU"[m]'
    9 |     m["THU"] = 3;
      |     ~~~~~~~~~^~~
a.cc:10:18: error: assignment of read-only location '"FRI"[m]'
   10 |         m["FRI"] = 2;
      |         ~~~~~~~~~^~~
a.cc:11:18: error: assignment of read-only location '"SAT"[m]'
   11 |         m["SAT"] = 1;
      |         ~~~~~~~~~^~~
a.cc:14:18: error: no match for 'operator[]' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   14 |         cout << m[temp];
      |                  ^
Language: C++

#include<bits/stdc++.h>
int main(){
	std::map<String, int> m{};
  	m["SUN"] = 7;
  	m["MON"] = 6;
  	m["TUE"] = 5;
  	m["WED"] = 4;
    m["THU"] = 3;
  	m["FRI"] = 2;
  	m["SAT"] = 1;
  	std::string temp;
  	std::cin >> temp;
  	std::cout << m[temp];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:18: error: 'String' was not declared in this scope
    3 |         std::map<String, int> m{};
      |                  ^~~~~~
a.cc:3:29: error: template argument 1 is invalid
    3 |         std::map<String, int> m{};
      |                             ^
a.cc:3:29: error: template argument 3 is invalid
a.cc:3:29: error: template argument 4 is invalid
a.cc:4:18: error: assignment of read-only location '"SUN"[m]'
    4 |         m["SUN"] = 7;
      |         ~~~~~~~~~^~~
a.cc:5:18: error: assignment of read-only location '"MON"[m]'
    5 |         m["MON"] = 6;
      |         ~~~~~~~~~^~~
a.cc:6:18: error: assignment of read-only location '"TUE"[m]'
    6 |         m["TUE"] = 5;
      |         ~~~~~~~~~^~~
a.cc:7:18: error: assignment of read-only location '"WED"[m]'
    7 |         m["WED"] = 4;
      |         ~~~~~~~~~^~~
a.cc:8:14: error: assignment of read-only location '"THU"[m]'
    8 |     m["THU"] = 3;
      |     ~~~~~~~~~^~~
a.cc:9:18: error: assignment of read-only location '"FRI"[m]'
    9 |         m["FRI"] = 2;
      |         ~~~~~~~~~^~~
a.cc:10:18: error: assignment of read-only location '"SAT"[m]'
   10 |         m["SAT"] = 1;
      |         ~~~~~~~~~^~~
a.cc:13:23: error: no match for 'operator[]' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   13 |         std::cout << m[temp];
      |                       ^
Language: C++

#include<bits/stdc++.h>
int main(){
	std::map<String, lli> m{};
  	m["SUN"] = 7;
  	m["MON"] = 6;
  	m["TUE"] = 5;
  	m["WED"] = 4;
    m["THU"] = 3;
  	m["FRI"] = 2;
  	m["SAT"] = 1;
  	std::string temp;
  	std::cin >> temp;
  	std::cout << m[temp];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:18: error: 'String' was not declared in this scope
    3 |         std::map<String, lli> m{};
      |                  ^~~~~~
a.cc:3:26: error: 'lli' was not declared in this scope
    3 |         std::map<String, lli> m{};
      |                          ^~~
a.cc:3:29: error: template argument 1 is invalid
    3 |         std::map<String, lli> m{};
      |                             ^
a.cc:3:29: error: template argument 2 is invalid
a.cc:3:29: error: template argument 3 is invalid
a.cc:3:29: error: template argument 4 is invalid
a.cc:4:18: error: assignment of read-only location '"SUN"[m]'
    4 |         m["SUN"] = 7;
      |         ~~~~~~~~~^~~
a.cc:5:18: error: assignment of read-only location '"MON"[m]'
    5 |         m["MON"] = 6;
      |         ~~~~~~~~~^~~
a.cc:6:18: error: assignment of read-only location '"TUE"[m]'
    6 |         m["TUE"] = 5;
      |         ~~~~~~~~~^~~
a.cc:7:18: error: assignment of read-only location '"WED"[m]'
    7 |         m["WED"] = 4;
      |         ~~~~~~~~~^~~
a.cc:8:14: error: assignment of read-only location '"THU"[m]'
    8 |     m["THU"] = 3;
      |     ~~~~~~~~~^~~
a.cc:9:18: error: assignment of read-only location '"FRI"[m]'
    9 |         m["FRI"] = 2;
      |         ~~~~~~~~~^~~
a.cc:10:18: error: assignment of read-only location '"SAT"[m]'
   10 |         m["SAT"] = 1;
      |         ~~~~~~~~~^~~
a.cc:13:23: error: no match for 'operator[]' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   13 |         std::cout << m[temp];
      |                       ^
Language: C++

#include<bits/stdc++>
int main(){
	std::map<String, lli> m{};
  	m["SUN"] = 7;
  	m["MON"] = 6;
  	m["TUE"] = 5;
  	m["WED"] = 4;
    m["THU"] = 3;
  	m["FRI"] = 2;
  	m["SAT"] = 1;
  	std::string temp;
  	std::cin >> temp;
  	std::cout << m[temp];
}


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

#include<bits/stdc++>
int main(){
	map<String, lli> m{};
  	m["SUN"] = 7;
  	m["MON"] = 6;
  	m["TUE"] = 5;
  	m["WED"] = 4;
    m["THU"] = 3;
  	m["FRI"] = 2;
  	m["SAT"] = 1;
  	std::string temp;
  	std::cin >> temp;
  	std::cout << m[temp];
}

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

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

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
    7 |     if (S = "SUN");
      |             ^~~~~
      |             |
      |             const char*
a.cc:9:15: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
    9 |     elif (S = "MON");
      |               ^~~~~
      |               |
      |               const char*
a.cc:9:5: error: 'elif' was not declared in this scope
    9 |     elif (S = "MON");
      |     ^~~~
a.cc:11:15: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   11 |     elif (S = "TUE");
      |               ^~~~~
      |               |
      |               const char*
a.cc:13:15: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   13 |     elif (S = "WED");
      |               ^~~~~
      |               |
      |               const char*
a.cc:15:15: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   15 |     elif (S = "THU");
      |               ^~~~~
      |               |
      |               const char*
a.cc:17:15: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   17 |     elif (S = "FRI");
      |               ^~~~~
      |               |
      |               const char*
a.cc:19:15: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   19 |     elif (S = "SAT");
      |               ^~~~~
      |               |
      |               const char*
Language: Java

import java.util.Scanner;
public class Main{

  public static void main(String[] args){
  B146.task3();
  }
}
public class B146 {

    public static void task1(){
        Scanner s = new Scanner(System.in);
        String str = s.next();
        String[] day = {"MON","TUE","WED","THU","FRI","SAT","SUN"};
        int[] l = {6,5,4,3,2,1,7};
        for (int i = 0; i < 7; i++){
            if (str.equals(day[i])) System.out.println(l[i]);

        }

    }

    public static void task2(){
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        char[] str = s.next().toCharArray();
        for (int i =0; i < str.length; i++){
            int ans = (((n + str[i]) - 'A') % 26) + 'A';
            str[i] = (char) ans;
        }
        System.out.println(new String(str));
    }

    public static void task3(){
        Scanner s = new Scanner((System.in));
        long a = s.nextLong(), b = s.nextLong(), x = s.nextLong();
        long MIN = 1;
        long MAX = (long) Math.pow(10, 9);
        long ans;
        //when u cant afford
        ans = (a + b > x) ? 0 : binarySearch(MIN,MAX,a,b,x);
        System.out.println((int) ans);


    }

    //split the range in half until the left is true and right is false
    public static long binarySearch(long left, long right, long a, long b, long x){

        if (right - left <= 1) return (predicate(a,b,right,x)?right : left);
        int mid = (int) Math.floor((left + right) / 2);
        //if the mid is affordable set left to mid
        if (predicate(a,b,mid,x)) {
            return binarySearch(mid,right,a,b,x);

        //otherwise set right to mid
        }else{
            return binarySearch(left,mid,a,b,x);
        }

    }

    public static Boolean predicate(long a, long b, long n, long x){
        //returns true if the integer is affordable
        return ( a * n + b * len(n) <=  x);
    }

    public static int len (long n){
        if (n == 0) return 0;
        return 1 + len(n/10);
    }
}


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

#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define INF LLONG_MAX - 100
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
#define lower_bound lowb
#define upper_bound upb
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> pque;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a*b/gcd(a,b);};
int mod(int a,int b){return (a+b-1)/b;};
int month[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;};

vector<string> lst={"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
int main() {
	string str;
	cin>>str;
	int pos=find(lst.begin(),lst.end(), str)-lst.begin();
	pos=-pos;
	pos+=7;
	pos%=7;
	if(pos==0) pos=7;
	cout<<pos<<"\n";
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: Java

import java.util.*;
import java.io.*;

public class abc146_a {
	public static void main(String[] args) {
		FastReader sc = new FastReader();

		String arr[] = { "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" };

		String s = sc.next();

		for (int i = 0; i < arr.length; i++) {
			if (s.equals(arr[i])) {
				System.out.println(7 - i);
			}
		}

	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}


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

#include <bits/stdc++.h>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected '(' before 's'
    9 |     switch s {
      |            ^
      |            (
Language: C++

#include <bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
#define eps 1e-9

typedef long long ll;

using namespace std;

const ll inf = 1e18;
const ll mod = 1e9+7;
const int N = 1e5+5;

int main()

{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    string s;

    cin >> s;

    if (s == "SUN") cout << "7";
    else if (s == "MON") cout << "6";
    else if (s == "TUE") cout << "5";
    else if (S == "Wed") cout << "4";
    else if (s == "Thu") cout << "3";
    else if (s == "FRI") cout << "2";
    else cout << "1";

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:14: error: 'S' was not declared in this scope
   25 |     else if (S == "Wed") cout << "4";
      |              ^
Language: C++

#include <bits/stdc++.h>


using namespace std;

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

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    long long a, b, c, x, max_price, ans;
    cin >> a >> b >> x;

    for (c = 0; c <= 10; c++)
    {
        if (a * pow(10, c) + b * (c + 1) > x)
            break;
    }
    if (c == 10)
    {
        max_price = 1000000000;
    }
    else
    {
        max_price = min(999999999, pow(10, c) - 1);
    }
    ans = (x - b * c) / a;
    cout << min(max_price, ans) << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: no matching function for call to 'min(int, __gnu_cxx::__promote<double>::__type)'
   22 |         max_price = min(999999999, pow(10, c) - 1);
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:22:24: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'})
   22 |         max_price = min(999999999, pow(10, c) - 1);
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

int main()
{
    long long a, b, c, x, max_price, ans;
    cin >> a >> b >> x;

    for (c = 0; c <= 10; c++)
    {
        if (a * pow(10, c) + b * (c + 1) > x)
            break;
    }
    if (c == 10)
    {
        max_price = 1000000000;
    }
    else
    {
        max_price = pow(10, c) - 1;
    }
    ans = (x - b * c) / a;
    cout << min(max_price, ans) << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> a >> b >> x;
      |     ^~~
a.cc:8:17: error: 'pow' was not declared in this scope
    8 |         if (a * pow(10, c) + b * (c + 1) > x)
      |                 ^~~
a.cc:17:21: error: 'pow' was not declared in this scope
   17 |         max_price = pow(10, c) - 1;
      |                     ^~~
a.cc:20:5: error: 'cout' was not declared in this scope
   20 |     cout << min(max_price, ans) << '\n';
      |     ^~~~
a.cc:20:13: error: 'min' was not declared in this scope; did you mean 'main'?
   20 |     cout << min(max_price, ans) << '\n';
      |             ^~~
      |             main
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll int
#define fi(a,b)	for(ll i=a;i<b;i++)
const ll mod=1e9+7;
ll cost(ll n,ll i){
	return a*n+b*i;
}
ll binsr(ll r,ll l,ll x,ll n){
	while(l<r){
		ll mid=1LL*(r+l)/2;
		if(cost(mid,n)<=x && cost(mid+1,n)>x)	return mid;
		if(cost(mid,n)>x && cost(mid-1,n)<=x)	return mid-1;
		if(cost(mid,n)<x)		l=mid;
		else	r=mid;
	}
}
int main(){
	ll arr[9];
	ll x;
	cin>>a>>b>>x;
	fi(0,9)	
		arr[i]=a*pow(10,i)+b*(i+1);
	int i=0;
	while(arr[i]<x)	i++;
	if(i==9){	cout<<1000000000;	return 0;
	}
	ll min=pow(10,i-1);
	ll max=(pow(10,i)-1);
	ll ans=binsr(min,max,x,i);
	cout<<ans;
	return 0;
}

Compiler output:
a.cc: In function 'int cost(int, int)':
a.cc:7:16: error: 'a' was not declared in this scope
    7 |         return a*n+b*i;
      |                ^
a.cc:7:20: error: 'b' was not declared in this scope
    7 |         return a*n+b*i;
      |                    ^
a.cc: In function 'int main()':
a.cc:21:14: error: 'a' was not declared in this scope
   21 |         cin>>a>>b>>x;
      |              ^
a.cc:21:17: error: 'b' was not declared in this scope
   21 |         cin>>a>>b>>x;
      |                 ^
a.cc: In function 'int binsr(int, int, int, int)':
a.cc:17:1: warning: control reaches end of non-void function [-Wreturn-type]
   17 | }
      | ^
Language: C

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

int main() {
  char list[][4] = { "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" }
  char s[4];
  scanf("%s", s);
  for (int i = 0; i < 7; ++i) {
    if (strcmp(s, list[i]) == 0) {
      printf("%d\n", 7 - i);
      return 0;
    }
  }
}


Compiler output:
main.c: In function 'main':
main.c:6:3: error: expected ',' or ';' before 'char'
    6 |   char s[4];
      |   ^~~~
main.c:7:15: error: 's' undeclared (first use in this function)
    7 |   scanf("%s", s);
      |               ^
main.c:7:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    //char s[7]={'sat','sun','mon','tue','wed','thu','fri','sat'};
    string s[10]={"Sat","Sun","Mon","Tue","Wed","Thu","Fri"};
    string s2;
    cin>>s2;
    int i,j,count=0,d;
    for(i=0;i<7;i++)
    {

        if(strcmp(s[i],s2)==0)

        {
            j=i+1;
            while(s[j]!="Sun")
            {
                count++;
                j++;
            }
            if(s[j]=="Sun") break;
        }
    }
    cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   13 |         if(strcmp(s[i],s2)==0)
      |                   ~~~^
      |                      |
      |                      std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
Language: C

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

int main()
{
    char D1[4] ="SUN";
    char D2[4] ="MON";
    char D3[4] ="TUE";
    char D4[4] ="WED";
    char D5[4] ="THU";
    char D6[4] ="FRI";
    char D7[4] ="SAT";
    int Check=0;

    char S[4];
    scanf("%[^\n]", &S);
    for( int i=0; i<4; i++){
        if(S[i]!=D1[i]){
            Check = 0;
            break;
        }
        else{
            Check++;
            if(Check==3){
                printf("7");
            }
            
        }
    }
    for( int i=0; i<4; i++){
        if(S[i]!=D2[i]){
            Check = 0;
            break;
        }
        else{
            Check++;
            if(Check==3){
                printf("6");
            }
            
        }
    }
    for( int i=0; i<4; i++){
        if(S[i]!=D3[i]){
            Check = 0;
            break;
        }
        else{
            Check++;
            if(Check==3){
                printf("5");
            }
            
        }
    }
    for( int i=0; i<4; i++){
        if(S[i]!=D4[i]){
            Check = 0;
            break;
        }
        else{
            Check++;
            if(Check==3){
                printf("4");
            }
            
        }
    }
    for( int i=0; i<4; i++){
        if(S[i]!=D5[i]){
            Check = 0;
            break;
        }
        else{
            Check++;
            if(Check==3){
                printf("3");
            }
            
        }
    }
    for( int i=0; i<4; i++){
        if(S[i]!=D6[i]){
            Check = 0;
            break;
        }
        else{
            Check++;
            if(Check==3){
                printf("2");
            }
            
        }
    }
    for( int i=0; i<4; i++){
        if(S[i]!=D7[i]){
            Check = 0;
            break;
        }
        else{
            Check++;
            if(Check==3){
                printf("1");
            }
            
        }
    }
    
}
Seen by TAM at 8:40 PM

Type a message...



Compiler output:
main.c:110:1: error: unknown type name 'Seen'
  110 | Seen by TAM at 8:40 PM
      | ^~~~
main.c:110:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'TAM'
  110 | Seen by TAM at 8:40 PM
      |         ^~~
main.c:110:9: error: unknown type name 'TAM'