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

#include <iostream>
#include <cstdio>
#include <stack>
#include <string>
#include <cstdlib>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)
int main() {
	char str[80+4];
	while(gets(str) != NULL) {
		stack<double> s;
		string t;
		int len = strlen(str);
		if(len == 0) break; 
		rep(i,len) {
			if(str[i] == ' ') {
				if(isdigit(t[0])) {
					double n = atof(t.c_str());
					s.push(n);
				} else {
					double a = s.top(); s.pop();
					double b = s.top(); s.pop();
					double c;
					if(t == "+") c = a + b;
					else if(t == "-") c = b - a;
					else if(t == "*") c = a * b;
					else c = b / a;						
					s.push(c);
				}
				t = "";
			} else {
				t += str[i];
			}
		}
		double a = s.top(); s.pop();
		double b = s.top(); s.pop();
		if(t == "+") printf("%.6lf\n", a + b);
		else if(t == "-") printf("%.6lf\n", b - a);
		else if(t == "*") printf("%.6lf\n", a * b);
		else printf("%.6lf\n", b / a);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
   11 |         while(gets(str) != NULL) {
      |               ^~~~
      |               getw
a.cc:14:27: error: 'strlen' was not declared in this scope
   14 |                 int len = strlen(str);
      |                           ^~~~~~
a.cc:6:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <cstdlib>
  +++ |+#include <cstring>
    6 | using namespace std;
Language: C++

#include <iostream>
#include <cstdio>
#include <stack>
#include <string>
#include <cstring>
#include <sstream>
#include <cstdlib>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)
int main() {
	string str;
	while(getline(cin, str)) {
		stack<double> s;
		stringstream ss;
		ss << str;
		while(ss >> str) {
			if(s[0] >= '0' && s[0] <= '9' || s.size() > 1) {
				s.push(atoi(str.c_str()));
			} else {
				double a = s.top(); s.pop();
				double b = s.top(); s.pop();
				double c;
				if(str[0] == '+') c = a + b;
				else if(str[0] == '-') c = b - a;
				else if(str[0] == '*') c = a * b;
				else c = b / a;						
				s.push(c);
			}
		}
		printf("%.6lf\n", s.top());
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:29: error: no match for 'operator[]' (operand types are 'std::stack<double>' and 'int')
   18 |                         if(s[0] >= '0' && s[0] <= '9' || s.size() > 1) {
      |                             ^
a.cc:18:44: error: no match for 'operator[]' (operand types are 'std::stack<double>' and 'int')
   18 |                         if(s[0] >= '0' && s[0] <= '9' || s.size() > 1) {
      |                                            ^
Language: C++

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

stack<double> st;

double stoi(string s){
  double ret=0;
  bool flag=true;
  int n;
  for(int i=0; i<s.length(); i++)
    if(s[i]=='.'){flag=false; n=i; while(true); continue;}
    if(flag){ret=ret*10+(s[i]-'0');}
    else{ret+=(s[i]-'0')*pow(10.0, -(n-i));}
  return ret;
}

int main(){
  string s;
  while(getline(cin, s)){
    stringstream ss(s);
    string t;
    while(getline(ss, t, ' ')){
      if(t=="+"){
        double c1=st.top(); st.pop();
        double c2=st.top(); st.pop();
        st.push(c1+c2);
      }
      else if(t=="-"){
        double c1=st.top(); st.pop();
        double c2=st.top(); st.pop();
        st.push(c2-c1);
      }
      else if(t=="*"){
        double c1=st.top(); st.pop();
        double c2=st.top(); st.pop();
        st.push(c1*c2);
      }
      else if(t=="/"){
        double c1=st.top(); st.pop();
        double c2=st.top(); st.pop();
        st.push(c2/c1);
      }
      else{
        st.push(stoi(t));
      }
    }
    printf("%.8f\n", st.top());
    while(!st.empty())st.pop();
  }
  return 0;
}

Compiler output:
a.cc: In function 'double stoi(std::string)':
a.cc:13:28: error: 'i' was not declared in this scope
   13 |     if(flag){ret=ret*10+(s[i]-'0');}
      |                            ^
a.cc:14:18: error: 'i' was not declared in this scope
   14 |     else{ret+=(s[i]-'0')*pow(10.0, -(n-i));}
      |                  ^
a.cc: In function 'int main()':
a.cc:45:21: error: call of overloaded 'stoi(std::string&)' is ambiguous
   45 |         st.push(stoi(t));
      |                 ~~~~^~~
a.cc:7:8: note: candidate: 'double stoi(std::string)'
    7 | double stoi(string s){
      |        ^~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:2:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
Language: C++

while s=gets
  a=s.chomp.split ' '
  ls = []
  for i in 0...a.length
    c = a[i]
    if c=="+" || c=="-" || c=="*" || c=="/"
      x=ls.pop
      y=ls.pop
      if c=="+"
        ls.push y+x
      elsif c=="-"
        ls.push y-x
      elsif c=="*"
        ls.push y*x
      elsif c=="/"
        ls.push y/x
      end
    else
      ls.push c.to_f
    end
  end
  puts sprintf("%.9f",ls[0])
end

Compiler output:
a.cc:4:12: error: too many decimal points in number
    4 |   for i in 0...a.length
      |            ^~~~~~~~~~~~
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while s=gets
      | ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string str;
    while(getline(cin,str)){
        stack<double> st;
        for(int i=0,point=0;;i++){
            if(str[i]==' '||str[i]=='\0'){
                int num[2]={};
                if(i-point==1){
                    if(str[point]-'0'>9||str[point]-'0'<0){
                        double righ=st.top();
                        st.pop();
                        double lef=st.top();
                        st.pop();
                        if(str[point]=='+')st.push(lef+righ);
                        else if(str[point]=='-')st.push(lef-righ);
                        else if(str[point]=='*')st.push(lef*righ);
                        else st.push(lef/righ);
                        }
                    else st.push(str[point]-'0');
                }
                else if(i-point==2){
                    if(str[point]=='-')st.push(-1*(str[i-1]-'0'));
                    else st.push((str[point]-'0')*10+(str[i-1]-'0'));
                }
                else st.push(-1*((str[i-2]-'0')*10+(str[i-1]-'0')))
                if(str[i]=='\0')break;
                point=i+1;
            }
        }
        if(!st.size())cout<<str<<endl;
        else printf("%lf\n",st.top());
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:68: error: expected ';' before 'if'
   28 |                 else st.push(-1*((str[i-2]-'0')*10+(str[i-1]-'0')))
      |                                                                    ^
      |                                                                    ;
   29 |                 if(str[i]=='\0')break;
      |                 ~~
Language: C++

#include <iostream>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <iomanip>
using namespace std;

double S[1000];
int f=0;

void push(double num){
  S[f]=num;
  f++;
}

double pop(){
  f--;
  double a=S[f];
  return a;
}

int main(){
  double num1,num2;
  char a[100],str[100];
  while(gets(a)!=EOF){
    f=0;
    for(int i=0,j=0;a[i]!='\0';i++){
      //cout << j<<endl;
      if((a[i]=='+'||a[i]=='-'||a[i]=='*'||a[i]=='/')&&(a[i+1]==' '||a[i+1]=='\0')){
        num1=pop();
        num2=pop();
        switch(a[i]){
        case '+':
          push(num2+num1);
          break;
        case '-':
          push(num2-num1);
          break;
        case '*':
          push(num2*num1);
          break;
        case '/':
          push(num2/num1);
          break;
        }
        //num1=pop();
        //cout<<num1<<endl;
        //push(num1);
        i++;
        continue;
      }
      if(a[i]==' '||a[i]=='\0'){
        str[j]='\0';
        j=0;
        //printf("%s\n",str);
        push(atof(str));
        if(a[i]=='\0'){
          break;
        }
      }
      str[j]=a[i];j++;
    }
    cout<< fixed << setprecision(6) << pop()<<endl;
  }
  return 0;
}

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

import sys
def line():return sys.stdin.readline().strip()

ops = {"+":lambda a,b:b + a,
     "-":lambda a,b:b - a,
     "*":lambda a,b:b * a,
     "/":lambda a,b:b / a}
while True:
    try:
        stack = []
        for s in line().split():
            if s in ops:
                stack.append(ops[s](stack.pop(),stack.pop()))
            else:
                stack.append(int(s))
        print(stack[0])
    except:
        break

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:1: error: expected unqualified-id before 'while'
    8 | while True:
      | ^~~~~
Language: C++

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

char s[100];
char buf[100];
int main() {
	while (gets_s(buf)) {
		stack<double>st;
		char*S = buf;
		while (S < buf + strlen(buf)) {
			sscanf(S, "%s", s);
			if (s[0] == '+') {
				double a = st.top(); st.pop();
				double b = st.top(); st.pop();
				st.push(b + a);
			}
			else if (s[0] == '-') {
				double a = st.top(); st.pop();
				double b = st.top(); st.pop();
				st.push(b - a);
			}
			else if (s[0] == '*') {
				double a = st.top(); st.pop();
				double b = st.top(); st.pop();
				st.push(b*a);
			}
			else if (s[0] == '/') {
				double a = st.top(); st.pop();
				double b = st.top(); st.pop();
				st.push(b / a);
			}
			else {
				st.push(atof(s));
			}
			S += strlen(s) + 1;
		}
		printf("%.6lf\n", st.top());
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: 'gets_s' was not declared in this scope; did you mean 'getsid'?
   10 |         while (gets_s(buf)) {
      |                ^~~~~~
      |                getsid
Language: C++

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

char s[100];
char buf[100];
int main() {
	while (gets(buf)) {
		stack<double>st;
		char*S = buf;
		while (S < buf + strlen(buf)) {
			sscanf(S, "%s", s);
			if (s[0] == '+') {
				double a = st.top(); st.pop();
				double b = st.top(); st.pop();
				st.push(b + a);
			}
			else if (s[0] == '-') {
				double a = st.top(); st.pop();
				double b = st.top(); st.pop();
				st.push(b - a);
			}
			else if (s[0] == '*') {
				double a = st.top(); st.pop();
				double b = st.top(); st.pop();
				st.push(b*a);
			}
			else if (s[0] == '/') {
				double a = st.top(); st.pop();
				double b = st.top(); st.pop();
				st.push(b / a);
			}
			else {
				st.push(atof(s));
			}
			S += strlen(s) + 1;
		}
		printf("%.6lf\n", st.top());
	}
}

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

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<stack>
#include<cstring>
#include<string>
#include<sstream>
using namespace std;

int main()
{
	string s;
	while (getline(cin, s)) {
		if (cin.eof())break;//if(s=="")break;
		stack<double> st;
		stringstream ss(s);
		string tmp;
		while (ss >> tmp) {
			if (tmp == "+" || tmp == "-" || tmp == "*" || tmp == "/") {//???????¨?????????\????????£??????
				if (st.empty())break;//?????????????????????????????£????????????
				double z1 = st.top();
				st.pop();//stack?????????????????????
				double z2 = st.top();
				st.pop();//stack?????????????????????
				double z3 = 0.0;
				if (tmp == "+")z3 = z2 + z1;
				else if (tmp == "-")z3 = z2 - z1;
				else if (tmp == "*")z3 = z2 * z1;
				else if (tmp == "/")z3 = z2 / z1;
				st.push(z3);
			}
			else {//??°????????\????????£??????
				st.push(atof(tmp));//double?????????????????????????????\??????
			}
		}
		printf("%.6f\n", st.top());
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:46: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   34 |                                 st.push(atof(tmp));//double?????????????????????????????\??????
      |                                              ^~~
      |                                              |
      |                                              std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:102:33: note:   initializing argument 1 of 'double atof(const char*)'
  102 | extern double atof (const char *__nptr)
      |                     ~~~~~~~~~~~~^~~~~~
Language: C++

#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
  string s;
  while(getline(cin,s)){
    s+=' ';
    stack<double>st;
    double p=0;
    int t=0;
    r(i,s.size()){
      if(s[i]==' '&&isdigit(s[i-1])){
        if(p!=0){
          if(!t)st.push(p),p=0;
          else st.push((-1)*p),p=0,t=0;
        }
      }
      else if(s[i]=='*'){
        double x1=st.top();st.pop();
        double x2=st.top();st.pop();
        st.push(x2*x1);
      }
      else if(s[i]=='+'){
        double x1=st.top();st.pop();
        double x2=st.top();st.pop();
        st.push(x2+x1);
      }
      else if(s[i]=='/'){
        double x1=st.top();st.pop();
        double x2=st.top();st.pop();
        st.push(x2/x1);
      }
      else if(s[i]=='-'){
        if(isdigit(s[i+1]))t=++;
        else{
          double x1=st.top();st.pop();
          double x2=st.top();st.pop();
          st.push(x2-x1);
        }
      }
      else if(isdigit(s[i])){
        p*=10,p+=s[i]-'0';
      } 
    }
    printf("%.6f\n",st.top());
  }
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:32: error: expected primary-expression before ';' token
   34 |         if(isdigit(s[i+1]))t=++;
      |                                ^
a.cc: At global scope:
a.cc:48:1: error: expected declaration before '}' token
   48 | }
      | ^
Language: C++

#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
  string s;
  while(getline(cin,s)){
    s+=' ';
    stack<double>st;
    double p=0;
    int t=0;
    r(i,s.size()){
      if(s[i]==' '&&isdigit(s[i-1])){
        if(p!=0){
          if(!t)st.push(p),p=0;
          else st.push((-1)*p),p=0,t=0;
        }
      }
      else if(s[i]=='*'){
        double x1=st.top();st.pop();
        double x2=st.top();st.pop();
        st.push(x2*x1);
      }
      else if(s[i]=='+'){
        double x1=st.top();st.pop();
        double x2=st.top();st.pop();
        st.push(x2+x1);
      }
      else if(s[i]=='/'){
        double x1=st.top();st.pop();
        double x2=st.top();st.pop();
        st.push(x2/x1);
      }
      else if(s[i]=='-'){
        if(isdigit(s[i+1]))t++;
        else{
          double x1=st.top();st.pop();
          double x2=st.top();st.pop();
          st.push(x2-x1);
        }
      }
      else if(isdigit(s[i])){
        p*=10,p+=s[i]-'0';
      } 
    }
    printf("%.6f\n",st.top());
  }
}
}

Compiler output:
a.cc:48:1: error: expected declaration before '}' token
   48 | }
      | ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>
#include<stack>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }
char s[1000];

int main() {
	string str;
	stack<double> num;
	while(gets(s)){
		str=s;
		//cout<<str;
		int i;
		for(i=0;i<str.size();){
			if('0'<=str[i]&&str[i]<='9'){
				double d=0;
				while('0'<=str[i]&&str[i]<='9'){
					d=d*10+str[i]-'0';
					i++;
				}
				num.push(d);
				
				//cout<<d<<endl;
			}else if(str[i]!=' '&&str[i]!='\n'){
			//cout<<str[i]<<endl;
				double a,b;
				a=num.top();
				num.pop();
				b=num.top();
				num.pop();
				if(str[i]=='+')num.push(a+b);
				if(str[i]=='-')num.push(b-a);
				if(str[i]=='*')num.push(a*b);
				if(str[i]=='/')num.push(b/a);
				i++;
				//cout<<num.top()<<endl;
			}else i++;
		}
		cout<<num.top()<<endl;
		num.pop();
	}
	return 0;
}

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

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

char s[100];
double st[100];

int main() {
	while(gets(s)){
		int i;
		int pos=0;
		double a=0;
		bool num=false;
		for(i=0;i<strlen(s);i++){
//cout<<pos<<endl;
//cout<<"  "<<st[0]<<endl;
//cout<<"  "<<st[1]<<endl;
//cout<<"  "<<st[2]<<endl;
			if('0'<=s[i]&&s[i]<='9'){
				a=a*10+s[i]-'0';
				num=true;
			}else if(s[i]==' '){
				if(num)st[pos++]=a;
				a=0;
				num=false;
			}else if(s[i]=='+'){
				st[pos-2]=st[pos-2]+st[pos-1];
				pos--;
			}else if(s[i]=='-'){
				st[pos-2]=st[pos-2]-st[pos-1];
				pos--;
			}else if(s[i]=='*'){
				st[pos-2]=st[pos-2]*st[pos-1];
				pos--;
			}else{
				st[pos-2]=st[pos-2]/st[pos-1];
				pos--;
			}
		}
		cout<<st[0]<<endl;
	}
	return 0;
}

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

#include <cstdio>
#include <stdlib.h>
#include <stack>
#include <iostream>

using namespace std;

int main(int argc, char const* argv[])
{
	char str[81];
	stack<double> data;
	double a,b;

	while( 1 ){
		gets( str );
		char *t;

		while( data.empty() == false ) data.pop();

		t = strtok( str, " " );
		if( t[0] < '0' || t[0] > '9' ){
				a = data.top();
				data.pop();
				b = data.top();
				data.pop();
			if( t[0] == '+' ){
				data.push( b + a );
			}
			if( t[0] == '-' ){
				data.push( b - a );
			}
			if( t[0] == '/' ){
				data.push( b / a );
			}
			if( t[0] == '*' ){
				data.push( b * a );
			}
		} else {
			data.push( atof( t ) );
		}

		while( ( t = strtok( NULL, " " ) ) != NULL ){
			if( t[0] < '0' || t[0] > '9' ){
				a = data.top();
				data.pop();
				b = data.top();
				data.pop();
				if( t[0] == '+' ){
					data.push( b + a );
				}
				if( t[0] == '-' ){
					data.push( b - a );
				}
				if( t[0] == '/' ){
					data.push( b / a );
				}
				if( t[0] == '*' ){
					data.push( b * a );
				}
			} else {
				data.push( atof( t ) );
			}
		}
		printf("%.6f\n",data.top());
		data.pop();

	}
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:15:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   15 |                 gets( str );
      |                 ^~~~
      |                 getw
a.cc:20:21: error: 'strtok' was not declared in this scope; did you mean 'strtoq'?
   20 |                 t = strtok( str, " " );
      |                     ^~~~~~
      |                     strtoq
Language: C++

#include <cstdio>
#include <stdlib.h>
#include <stack>
#include <iostream>
#include <string.h>

using namespace std;

int main(int argc, char const* argv[])
{
	char str[81];
	stack<double> data;
	double a,b;

	while( 1 ){
		gets( str );
		char *t;

		while( data.empty() == false ) data.pop();

		t = strtok( str, " " );
		if( t[0] < '0' || t[0] > '9' ){
				a = data.top();
				data.pop();
				b = data.top();
				data.pop();
			if( t[0] == '+' ){
				data.push( b + a );
			}
			if( t[0] == '-' ){
				data.push( b - a );
			}
			if( t[0] == '/' ){
				data.push( b / a );
			}
			if( t[0] == '*' ){
				data.push( b * a );
			}
		} else {
			data.push( atof( t ) );
		}

		while( ( t = strtok( NULL, " " ) ) != NULL ){
			if( t[0] < '0' || t[0] > '9' ){
				a = data.top();
				data.pop();
				b = data.top();
				data.pop();
				if( t[0] == '+' ){
					data.push( b + a );
				}
				if( t[0] == '-' ){
					data.push( b - a );
				}
				if( t[0] == '/' ){
					data.push( b / a );
				}
				if( t[0] == '*' ){
					data.push( b * a );
				}
			} else {
				data.push( atof( t ) );
			}
		}
		printf("%.6f\n",data.top());
		data.pop();

	}
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:16:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   16 |                 gets( str );
      |                 ^~~~
      |                 getw
Language: C++

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

bool digit(char c){
  return (c>='0') && (c<='9');
}

double stoi(string s){
  double k = 1.0,res = 0.0;
  for(int i = (int)s.size()-1;i>=0;i--){
    res += (s[i]-'0') * k;
    k *= 10;
  }
  return res;
}

double cal(double x, double y, char z){
  if(z == '+')return x+y;
  if(z == '-')return x-y;
  if(z == '*')return x*y;
  if(z == '/')return x/y;
  else return x+y;
}  

int main(){
  stack<double> a;
  char str[100];

  while(fgets(str,100,stdin)!=NULL){
    int pos = 0;
    while(1){
      if(str[pos] == '\n')break;
      if(digit(str[pos])){
	string tmp;
	tmp.push_back(str[pos]);
	while(1){
	  pos++;
	  if(str[pos] == ' ' || str[pos] == '\n')break;
	  tmp.push_back(str[pos]);
	}
	a.push(stoi(tmp));
	cout << "[" << a.top() << "]" << endl;
      }else if(str[pos] == ' '){
	pos++;
      }else if(str[pos] == '-' && digit(str[pos+1])){
	string tmp;
	pos++;
	tmp.push_back(str[pos]);
	while(1){
	  pos++;
	  if(str[pos] == ' ' || str[pos] == '\n')break;
	  tmp.push_back(str[pos]);
	}
	a.push(-1*stoi(tmp));
	cout << "[" << a.top() << "]" << endl;
      }else{
	double x,y;
	y = a.top();
	a.pop();
	x = a.top();
	a.pop();
	a.push(cal(x,y,str[pos]));
	pos++;
      }
    }
    
    //if(a.empty())cout << 0 << endl;
    else cout << a.top() << endl;
    
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:20: error: call of overloaded 'stoi(std::string&)' is ambiguous
   44 |         a.push(stoi(tmp));
      |                ~~~~^~~~~
a.cc:11:8: note: candidate: 'double stoi(std::string)'
   11 | double stoi(string s){
      |        ^~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
a.cc:57:23: error: call of overloaded 'stoi(std::string&)' is ambiguous
   57 |         a.push(-1*stoi(tmp));
      |                   ~~~~^~~~~
a.cc:11:8: note: candidate: 'double stoi(std::string)'
   11 | double stoi(string s){
      |        ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
a.cc:71:5: error: 'else' without a previous 'if'
   71 |     else cout << a.top() << endl;
      |     ^~~~
Language: C++

#include <iostream>
#include <stack>
#include <cstdio>
#include <cstdlib>
using namespace std;
int main()
{
	stack<double> s;
	double a, b;
	char c[80];
	while (cin >> c)
	{
		if (c == EOF) return 0;
		if (c[0] == '+')
		{
			b = s.top(), s.pop();
			a = s.top(), s.pop();
			s.push(a + b);
		}
		else if (c[0] == '-')
		{
			b = s.top(), s.pop();
			a = s.top(), s.pop();
			s.push(a - b);
		}
		else if (c[0] == '*')
		{			
			b = s.top(), s.pop();
			a = s.top(), s.pop();
			s.push(a * b);
		}
		else if (c[0] == '/')
		{			
			b = s.top(), s.pop();
			a = s.top(), s.pop();
			s.push(a / b);
		}
		else
			s.push(atof(c));
		if (cin.get() == '\n') 
			printf("%.6lf\n", s.top());
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |                 if (c == EOF) return 0;
      |                       ^
Language: C++

#include <iostream>
#include <stack>
#include <cstdio>
#include <cstdlib>
int main()
{
	stack<double> s;
	double a, b;
	char c[80], bf;
	while (std::cin >> c)
	{
		if (c[0] == '+')
		{
			b = s.top(), s.pop();
			a = s.top(), s.pop();
			s.push(a+b);
		}
		else if (c[0] == '-' && c[1] == 0)
		{
			b = s.top(), s.pop();
			a = s.top(), s.pop();
			s.push(a-b);
		}
		else if (c[0] == '*')
		{
			b = s.top(), s.pop();
			a = s.top(), s.pop();
			s.push(a*b);
		}
		else if (c[0] == '/')
		{
			b = s.top(), s.pop();
			a = s.top(), s.pop();
			s.push(a/b);
		}
		else
		{
			s.push(atof(c));
		}
		if ((bf = getchar()) == '\n')
			printf("%.6f\n", s.top());
		if (bf == -1)
			return 0;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'stack' was not declared in this scope; did you mean 'std::stack'?
    7 |         stack<double> s;
      |         ^~~~~
      |         std::stack
In file included from /usr/include/c++/14/stack:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_stack.h:99:11: note: 'std::stack' declared here
   99 |     class stack
      |           ^~~~~
a.cc:7:15: error: expected primary-expression before 'double'
    7 |         stack<double> s;
      |               ^~~~~~
a.cc:14:29: error: 's' was not declared in this scope
   14 |                         b = s.top(), s.pop();
      |                             ^
a.cc:20:29: error: 's' was not declared in this scope
   20 |                         b = s.top(), s.pop();
      |                             ^
a.cc:26:29: error: 's' was not declared in this scope
   26 |                         b = s.top(), s.pop();
      |                             ^
a.cc:32:29: error: 's' was not declared in this scope
   32 |                         b = s.top(), s.pop();
      |                             ^
a.cc:38:25: error: 's' was not declared in this scope
   38 |                         s.push(atof(c));
      |                         ^
a.cc:41:42: error: 's' was not declared in this scope
   41 |                         printf("%.6f\n", s.top());
      |                                          ^
Language: C++

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

int main(){
	char in[100] = {};
	while(cin.getline(in,99)&&in[0]){
		stack<double> s;
		for(int i = 0; i < 100; i++){
			while(c[i] == '.');
		}
		char* c = in;
		do{
			if('0' <= *c && *c <= '9'){
				int a = 0;
				while('0'<=*c && *c <= '9'){
					a *= 10;
					a += *c-'0';
					++c;
				}
				s.push((double)a);
			}else{
				double b = s.top();
				s.pop();
				double a = s.top();
				s.pop();
				switch(*c){
					case '+':
						s.push(a+b);
						break;
					case '-':
						s.push(a-b);
						break;
					case '*':
						s.push(a*b);
						break;
					case '/':
						while(b == 0);
						s.push(a/b);
						break;
				}
				++c;
			}
			++c;
		}while(*c);
		printf("%.6f\n",s.top());
		memset(in,0,sizeof in);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:31: error: 'c' was not declared in this scope
   12 |                         while(c[i] == '.');
      |                               ^
Language: C++

#include <stdio.h>
#include <string.h>
double RB[1005];double ans;int last;char T[99];
void divid() {int i,j=strlen(T);double k=0;T[j]='=';last=0;for (i=0;i<=j;i++) {if (T[i]>='0' && T[i]<='9') k=k*10+(T[i]-'0'); else {if (k) {RB[last++]=k,k=0;continue;} if (T[i]=='-') last--,RB[last-1]-=RB[last]; else if (T[i]=='+') last--,RB[last-1]+=RB[last]; else if (T[i]=='*') last--,RB[last-1]*=RB[last]; else if (T[i]=='/') last--,RB[last-1]/=RB[last];}} ans=RB[0];}
int main() {while (gets(T)!=NULL) {last=0;ans=0.000000;divid();printf("%.6lf\n",ans);} return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:20: error: 'gets' was not declared in this scope; did you mean 'getw'?
    5 | int main() {while (gets(T)!=NULL) {last=0;ans=0.000000;divid();printf("%.6lf\n",ans);} return 0;}
      |                    ^~~~
      |                    getw
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

double stod (string s )
{
	stringstream ss (s );
	double res;
	ss >> res;

	return res;
}

double Reverse_Polish_Natation (string t )
{
	stringstream ss (t );
	string s = "";
	stack<double> st;
	while (ss >> s ){
		if (isdigit (s[0] ) || (s[0] == '-' && s.length() > 1 && isdigit (s[1] ) ) ){
			st.push (stod (s ) );
		}else{
			double b = st.top(); st.pop();
			double a = st.top(); st.pop();
			double c = 0.0;
			char ope = s[0];
			switch (ope ){
				case '+': c = a + b; break;
				case '-': c = a - b; break;
				case '*': c = a * b; break;
				case '/': c = a / b; break;
			} // end switch
			st.push (c );
		} // end if
	} // end while

	double res = st.top();

	return res;
}

int main()
{a
//	cut here before submit 
//	freopen ("testcase.SME", "r", stdin );
	string str = "";
	while (getline (cin, str ) ){
		double res = Reverse_Polish_Natation (str );
		printf ("%.9lf\n", res );
	} // end loop
		
	return 0;
}

Compiler output:
a.cc: In function 'double Reverse_Polish_Natation(std::string)':
a.cc:48:39: error: call of overloaded 'stod(std::string&)' is ambiguous
   48 |                         st.push (stod (s ) );
      |                                  ~~~~~^~~~
a.cc:32:8: note: candidate: 'double stod(std::string)'
   32 | double stod (string s )
      |        ^~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4199:3: note: candidate: 'double std::__cxx11::stod(const std::string&, std::size_t*)'
 4199 |   stod(const string& __str, size_t* __idx = 0)
      |   ^~~~
a.cc: In function 'int main()':
a.cc:70:2: error: 'a' was not declared in this scope
   70 | {a
      |  ^
a.cc:74:30: error: 'str' was not declared in this scope; did you mean 'std'?
   74 |         while (getline (cin, str ) ){
      |                              ^~~
      |                              std
Language: C++

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

int main(){

  string s;
  double x,y;

  while(getline(cin,s)){
    double k = 0;
    bool p = false;
    stack < double > a

      for(int i=0;i<s.size();i++){
 
	if(s[i] == '+' || s[i] == '-' || s[i] == '*' || s[i] == '/'){
	  x = a.top();
	  a.pop();

	  y = a.top();
	  a.pop();

	  if(s[i] == '+')	a.push(y+x);
	  else if(s[i] == '-') a.push(y-x);
	  else if(s[i] == '*') a.push(y*x);
	  else if(s[i] == '/') a.push(y/x);

	}

	if(s[i] <=  '9' && s[i] >= '0'){
	  k *= 10;
	  k += (s[i] - '0');
	  p = true;
	}
 
	if(p == true && (s[i] == ' ' || s[i] == '\0')){
	  a.push(k);
	  k = 0;
	  p = false;
	}

      }
    printf("%.6f\n",a.top());
    a.pop();
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: expected initializer before 'for'
   17 |       for(int i=0;i<s.size();i++){
      |       ^~~
a.cc:17:19: error: 'i' was not declared in this scope
   17 |       for(int i=0;i<s.size();i++){
      |                   ^
a.cc:46:21: error: 'a' was not declared in this scope
   46 |     printf("%.6f\n",a.top());
      |                     ^
Language: C++

#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
int main(){
long i,j,k;
string s;
double a[80];
for(;;){
getline(cin,s);
if(s=="")break;
i=j=0;
for(;;){
while(s[j]==' ')j++;
if(s[j]==0)break;
else if(s[j]=='+'){i--;a[i]+=a[i+1];j++;}
else if(s[j]=='-'&&(s[j+1]==' '||s[j+1]==0){i--;a[i]-=a[i+1];j++;}
else if(s[j]=='*'){i--;a[i]*=a[i+1];j++;}
else if(s[j]=='/'){i--;a[i]/=a[i+1];j++;}
else{
k=s.find(' ',j);if(k==string::npos)k=s.size();
i++;a[i]=atof(s.substr(j,k-j).c_str());
j=k;
}
}
printf("%.6f\n",a[1]);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:44: error: expected ')' before '{' token
   17 | else if(s[j]=='-'&&(s[j+1]==' '||s[j+1]==0){i--;a[i]-=a[i+1];j++;}
      |        ~                                   ^
      |                                            )
a.cc:25:1: error: expected primary-expression before '}' token
   25 | }
      | ^
Language: C++

#include<stdio.h>
#include<stdlib.h>

double ds[100];
int dsp=sizeof(ds)/sizeof(ds[0]);

void dpush(double v) { if(dsp>0) ds[--dsp]=v; }                                 double dpop(void) { return (dsp<sizeof(ds)/sizeof(ds[0])?ds[dsp++]:0.0); }

double RPN( const char * f )
{
    double v;
    for(;*f;f++) {
        switch(*f){
        case '+' : v=dpop(); dpush(dpop()+v); break ;
        case '-' : v=dpop(); dpush(dpop()-v); break ;
        case '*' : v=dpop(); dpush(dpop()*v); break ;
        case '/' : v=dpop(); dpush(dpop()/v); break ;
        default :
            dpush(atof(f)) ;
            for(;*f>='0'&&*f<='9';i++);
            i--;
            break ;
        }
        i++;
    }
    return dpop();
}
int main(void){
    char s[81];
    while(fgets(s,sizeof(s),stdin)){
        printf("%f\n",RPN(s));
    }
    return 0;
}

Compiler output:
a.cc: In function 'double RPN(const char*)':
a.cc:20:35: error: 'i' was not declared in this scope
   20 |             for(;*f>='0'&&*f<='9';i++);
      |                                   ^
a.cc:21:13: error: 'i' was not declared in this scope
   21 |             i--;
      |             ^
a.cc:24:9: error: 'i' was not declared in this scope
   24 |         i++;
      |         ^
Language: C++

#include<iostream>
#include<stack>
#include<algorithm>
#include<string>
#include<cstdio>
using namespace std;
int main(){
    stack<double> st;
    double a, b;
    char s[105];
    char w;
    while(~scanf("%s%c", s, &w)){
	switch(s[0]){
	case '+':
	    a = st.top();st.pop();
	    b = st.top();st.pop();
	    st.push(b+a);
	    break;
	case '-':
	    a = st.top();st.pop();
	    b = st.top();st.pop();
	    st.push(b-a);
	    break;
	case '*':
	    a = st.top();st.pop();
	    b = st.top();st.pop();
	    st.push(b*a);
	    break;
	case '/':
	    a = st.top();st.pop();
	    b = st.top();st.pop();
	    if(a == 0)return 0;
	    st.push(b/a);
	    break;
	default:
a=0
	    sscanf(s, "%lf", &a);
	    st.push(a);
	}
	if(w == '\n'){
	    cout << st.top() << endl;
	    while(!st.empty())
		st.pop();
	}
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:4: error: expected ';' before 'sscanf'
   36 | a=0
      |    ^
      |    ;
   37 |             sscanf(s, "%lf", &a);
      |             ~~~~~~
Language: Java

import java.util.*;
import java.io.*;
import static java.lang.Math.*;

class Main {

    public static void main( final String[] args ) {

	final char[] inFromLst = { ' ', '\'', ',', '-', '.', '?', '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' };

	final String[] inToLst = { "101" ,"000000" ,"000011" ,"10010001" ,"010001" ,"000001" ,"100101" ,"10011010" ,"0101" ,"0001" ,"110" ,"01001" ,"10011011" ,"010000" ,"0111" ,"10011000" ,"0110" ,"00100" ,"10011001" ,"10011110" ,"00101" ,"111" ,"10011111" ,"1000" ,"00110" ,"00111" ,"10011100" ,"10011101" ,"000010" ,"10010010" ,"10010011" ,"10010000" };

	final HashMap<Character, String> inMap = new HashMap<Character, String>();
	for ( int i = 0; i < inFromLst.length; i++ ) {
	    inMap.put( inFromLst[ i ], inToLst[ i ] );
	}

	final String[] outFromLst = { "00000", "00001", "00010", "00011", "00100", "00101", "00110", "00111", "01000", "01001", "01010", "01011", "01100", "01101", "01110", "01111", "10000", "10001", "10010", "10011", "10100", "10101", "10110", "10111", "11000", "11001", "11010", "11011", "11100", "11101", "11110", "11111" };

	final char[] outToLst = { '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', ' ', '.', ',', '-', '\'', '?' };

	final Map<String, Character> outMap = new HashMap<String, Character>();
	for ( int i = 0; i < outFromLst.length; i++ ) {
	    outMap.put( outFromLst[ i ], outToLst[ i ] );
	}

	while ( stdin.hasNextLine() ) {
	    final Scanner stdin = new Scanner( System.in );
	    final String input = stdin.nextLine();
	    
	    final StringBuilder in = new StringBuilder();
	    for ( final char ch : input.toCharArray() ) {
		in.append( inMap.get( ch ) );
	    }
	    
	    for ( int i = 0; i < in.length() % 5; i++ ) {
		in.append( '0' );
	    }
	    final StringBuilder out = new StringBuilder();
	    final int no = in.length() / 5;
	    for ( int i = 0; i < no; i++ ) {
		final String token = in.substring( i * 5, ( i + 1 ) * 5 );
		out.append( outMap.get( token ) );
	    }
	    System.out.println( out.toString() );
	}
    }    
}

Compiler output:
Main.java:27: error: cannot find symbol
	while ( stdin.hasNextLine() ) {
	        ^
  symbol:   variable stdin
  location: class Main
1 error
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<conio.h>
int main()
{
	int c[99],m[32]={6,8,4,4,3,5,8,6,4,8,4,5,8,8,5,3,8,4,5,5,8,8,6,8,8,8,3,6,6,8,6,6},d[32]={37,154,5,1,6,9,155,16,7,152,6,4,153,158,5,7,159,8,6,7,156,157,2,146,147,144,5,0,3,145,17,1},
	buffer=0,t,p=0,i,w[32]={65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,32,46,44,45,39,63};

	c[32]=26,c[39]=27,c[44]=28,c[45]=29,c[46]=30,c[63]=31;
	for(i=0;i<25;i++)
		c[65+i]=i;
	while(t=getch())
	{
		if(t==13||t==26)
		{
			if(p>0)
				putchar(w[buffer<<5-p]);
			if(t==26)
				break;
			puts("");
			buffer=p=0;
		}
		else
		{
			i=c[t];
			buffer<<=m[i];
			buffer|=d[i];
			p+=m[i];
			for(;p>=5;p-=5)
			{
				putchar(w[buffer>>p-5]);
				buffer&=~(31<<p-5);
			}
		}
	}
	return 0;
}

Compiler output:
main.c:4:9: fatal error: conio.h: No such file or directory
    4 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
	int c[99],m[32]={6,8,4,4,3,5,8,6,4,8,4,5,8,8,5,3,8,4,5,5,8,8,6,8,8,8,3,6,6,8,6,6},d[32]={37,154,5,1,6,9,155,16,7,152,6,4,153,158,5,7,159,8,6,7,156,157,2,146,147,144,5,0,3,145,17,1},
	buffer=0,t,p=0,i,w[32]={65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,32,46,44,45,39,63};

	c[32]=26,c[39]=27,c[44]=28,c[45]=29,c[46]=30,c[63]=31;
	for(i=0;i<25;i++)
		c[65+i]=i;
	while(t=fgetchar())
	{
		if(t==13||t==26)
		{
			if(p>0)
				putchar(w[buffer<<5-p]);
			if(t==26)
				break;
			puts("");
			buffer=p=0;
		}
		else
		{
			i=c[t];
			buffer<<=m[i];
			buffer|=d[i];
			p+=m[i];
			for(;p>=5;p-=5)
			{
				putchar(w[buffer>>p-5]);
				buffer&=~(31<<p-5);
			}
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:17: error: implicit declaration of function 'fgetchar'; did you mean 'getchar'? [-Wimplicit-function-declaration]
   12 |         while(t=fgetchar())
      |                 ^~~~~~~~
      |                 getchar
Language: C

#include <stdio.h>
#include <string.h>
int main(void)
{
  int i,j;
  char *a = " ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  char *b[] = {
    "101","000000","000011","10010001","010001","000001","100101",
    "10011010","0101","0001","110","01001","10011011","010000","0111",
    "10011000","0110","00100","10011001","10011110","00101","111",
    "10011111","1000","00110","00111","10011100","10011101","000010",
    "10010010","10010011","10010000"
  };
  char *c = "ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?";
  char d[4096];
  char e[4096];
  //while(1) {
    puts("\nSample Input");
    if(!*gets(d)) break;
    e[0] = '\0';
    i = 0;
    while(d[i] != '\0') strcat(e,b[strchr(a,d[i++]) - a]);
    i = 5 - strlen(e) % 5;
    while(i--) strcat(e,"0");
    puts("Output for the Sample Input");
    i = 0;
    while(e[i] != '\0') {
      j = 0;
      j += (e[i++] - '0') << 4; 
      j += (e[i++] - '0') << 3; 
      j += (e[i++] - '0') << 2; 
      j += (e[i++] - '0') << 1; 
      j += (e[i++] - '0'); 
      putc(c[j],stdout);
    }
    //}
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:10: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   19 |     if(!*gets(d)) break;
      |          ^~~~
      |          fgets
main.c:19:9: error: invalid type argument of unary '*' (have 'int')
   19 |     if(!*gets(d)) break;
      |         ^~~~~~~~
main.c:19:19: error: break statement not within loop or switch
   19 |     if(!*gets(d)) break;
      |                   ^~~~~
Language: C

#include <stdio.h>
#include <string.h>
main()
{
  int i,j,k;
  char *a = " ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  char *b[] = {
    "101","000000","000011","10010001","010001","000001","100101",
    "10011010","0101","0001","110","01001","10011011","010000","0111",
    "10011000","0110","00100","10011001","10011110","00101","111",
    "10011111","1000","00110","00111","10011100","10011101","000010",
    "10010010","10010011","10010000"
  };
  char *c = "ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?";
  char d[4096];
  char e[4096];
  d[0] = '\0';
  //while(1) {
    gets(e);
    if(feof(stdin)) break;
    strcat(d,e);
    strcat(d," ");
    //}
  d[strlen(d) - 1] = '\0';
  e[0] = '\0';
  i = 0;
  while(d[i] != '\0') strcat(e,b[strchr(a,d[i++]) - a]);
  i = 5 - strlen(e) % 5;
  while(i--) strcat(e,"0");
  i = 0;
  while(e[i] != '\0') {
    j = 0;
    k = 4;
    do {
      j += (e[i++] - '0') << k;
    } while(k--);
    putc(c[j],stdout);
  }
  return 0;
}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main()
      | ^~~~
main.c: In function 'main':
main.c:19:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   19 |     gets(e);
      |     ^~~~
      |     fgets
main.c:20:21: error: break statement not within loop or switch
   20 |     if(feof(stdin)) break;
      |                     ^~~~~
Language: C

#include <stdio.h>
main()
{
  int i,j,k;
  unsigned char *a = "\n ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  unsigned char *b[] = {
    "101","101","000000","000011","10010001","010001","000001","100101",
    "10011010","0101","0001","110","01001","10011011","010000","0111",
    "10011000","0110","00100","10011001","10011110","00101","111",
    "10011111","1000","00110","00111","10011100","10011101","000010",
    "10010010","10010011","10010000"
  };
  unsigned char *c = "ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?";
  unsigned char d[4096];
  unsigned char *p;
  i = 0;
  while((k = getc(stdin)) != EOF){
    j = 0;
    //while(*(a + j) != k) j++;
    //p = b[j];
    //while(*p) d[i++] = *p++;
  }
  j = 5 - i % 5;
  while(j--) d[i++] = '0';
  d[i] = '\0';
  i = 0;
  while(d[i]) {
    j = 0;
    k = 4;
    do {
      j += (d[i++] - '0') << k;
    } while(k--);
    putc(*(c + j),stdout);
  }
  */
  return 0;
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main()
      | ^~~~
main.c: In function 'main':
main.c:35:4: error: expected expression before '/' token
   35 |   */
      |    ^
Language: C

#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include <queue>
#include <cmath>
#include <stack>
#include <map>

#define int64 long long int 
using namespace std;

string encode(string, char);
void decode(string);

int main()
{
	int c;
	string str;
	while((c = getchar()) != EOF){
		str = encode(str, c);
	}
	decode(str);

	return 0;
}

void decode(string str)
{
	int i, len, r;
	string part;
	const string code[32] = {
		"00000", "00001", "00010", "00011", "00100", "00101", "00110", "00111",
		"01000", "01001", "01010", "01011", "01100", "01101", "01110", "01111",
		"10000", "10001", "10010", "10011", "10100", "10101", "10110", "10111",
		"11000", "11001", "11010", "11011", "11100", "11101", "11110", "11111"
	};
	const char ch[35] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ .,-'?";

	len = str.size();

	for(i=0; i<len / 5; i++){
		part = str.substr( 5*i, 5 );
		for(int j=0; j<32; j++)
			if(part == code[j]) cout << ch[j];
	}
	if((r = len % 5) != 0){
		part = str.substr( 5*i, len-1 );
		for(i=0; i<5-r; i++) part += "0";
		for(i=0; i<32; i++)
			if(part == code[i]) cout << ch[i];
	}
	cout << endl;
	return;
}

string encode(string str, char c)
{
	const string code[32] = {
		"101", "000000", "000011", "10010001",
		"010001", "000001", "100101", "10011010",
		"0101", "0001", "110", "01001",
		"10011011", "010000", "0111", "10011000",
		"0110", "00100", "10011001", "10011110",
		"00101", "111", "10011111", "1000",
		"00110", "00111", "10011100", "10011101",
		"000010", "10010010", "10010011", "10010000"
	};
	const char ch[35] = " ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 

	for(int i=0; i<32; i++){
		if(c == ch[i]){
			if(str.empty()) str = code[i];
			else str += code[i];
		}
	}
	return str;
}

Compiler output:
main.c:3:10: fatal error: iostream: No such file or directory
    3 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.