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

#include<iostream>
using namespace std;

int main()
{
    int a,b;
    int hen[101]={};
    while(cin>>a>>b)
    {
        
        hen[a-1]++;
        hen[b-1]++;
        if(a==0){
            if(hen[0]%2==1&&hen[1]%2==1)
            {
                for(int i=2;i<101;i++){
                   if(i<100&&hen[i]%2==1)
                       cout<<"NG"<<endl;
                    if(i==100)cout<<"OK"<<endl;
                    else
                        cout<<"NG"<<endl;
                }
            
            for(int i=0;i<101;i++)
                hen[i]=0;
            }
        
        }
    return 0;
}

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

#include<iostream>
using namespace std;

int main()
{
    int a,b;
    int hen[100]={};
    while(cin>>a>>b)
    {
        hen[a-1]++;
        hen[b-1]++;
        if(a==0){
            if(hen[0]%2==1&&hen[1]%2==1){
                for(int i=2;i<101;i++){
                    if(i<100&&hen[i]%2==1){
                       cout<<"NG"<<endl;
                        break;
                    }
                    if(i==100)cout<<"OK"<<endl;
                }
                
                else
                    cout<<"NG"<<endl;
            
            for(int i=0;i<100;i++)
                hen[i]=0;
            }
        }
        
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: expected '}' before 'else'
   22 |                 else
      |                 ^~~~
a.cc:13:41: note: to match this '{'
   13 |             if(hen[0]%2==1&&hen[1]%2==1){
      |                                         ^
a.cc: At global scope:
a.cc:31:5: error: expected unqualified-id before 'return'
   31 |     return 0;
      |     ^~~~~~
a.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^
Language: C++


#include<iostream>
using namespace std;

int main()
{
    int a,b;
    int hen[100]={};
    while(cin>>a>>b)
    {
        hen[a-1]++;
        hen[b-1]++;
        if(a==0){
            if(hen[0]%2==1&&hen[1]%2==1){
                for(int i=2;i<101;i++){
                    if(i<100&&hen[i]%2==1){
                       cout<<"NG"<<endl;
                        break;
                    }
                    if(i==100)cout<<"OK"<<endl;
                }
            }
            else
                cout<<"NG"<<endl;
            
            for(int i=0;i<100;i++)
                hen[i]=0;
            }
        }
        
    }
    return 0;
}

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

#include<iostream>
using namespace std;

int main()
{
    int a,b;
    int hen[100]={0};
    while(cin>>a>>b)
    {
        hen[a-1]++;
        hen[b-1]++;
        if(a==0){
            if(hen[0]%2==1&&hen[1]%2==1){
                for(int i=2;i<101;i++){
                    if(i<100&&hen[i]%2==1){
                       cout<<"NG"<<endl;
                        break;
                    }
                    if(i==100)cout<<"OK"<<endl;
                }
            }
            else
                cout<<"NG"<<endl;
            
            for(int i=0;i<100;i++)
                hen[i]=0;
            }
        }
        
    }
    return 0;
}

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

namespace std;
int a, b, c;
int s[51][101]={};

int main() 
{
	c=0;
	while(cin >> a >> b)
	{
		if(a!=0)
		{
			s[c][a]++;
			s[c][b]++;
		}
		else
		{
			s[c][1]++;
			s[c][2]++;
			int t=0;
			for(int i=1; i<=100; i++)
			{
				if(s[c][i]%2!=0)
				{
					t++;
					break;
				}
			}
			if(t==0)
			{
				cout << "OK" << endl;
			}
			else
			{
				cout << "NG" << endl;
			}
			c++;
		}
	}
	return 0;
}

Compiler output:
a.cc:1:14: error: expected '{' before ';' token
    1 | namespace std;
      |              ^
a.cc: In function 'int main()':
a.cc:8:15: error: 'cin' was not declared in this scope
    8 |         while(cin >> a >> b)
      |               ^~~
a.cc:30:33: error: 'cout' was not declared in this scope
   30 |                                 cout << "OK" << endl;
      |                                 ^~~~
a.cc:30:49: error: 'endl' was not declared in this scope
   30 |                                 cout << "OK" << endl;
      |                                                 ^~~~
a.cc:34:33: error: 'cout' was not declared in this scope
   34 |                                 cout << "NG" << endl;
      |                                 ^~~~
a.cc:34:49: error: 'endl' was not declared in this scope
   34 |                                 cout << "NG" << endl;
      |                                                 ^~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
	int a, b, v[101], p;
	while(cin >> a && cin >> b){
		v[a]++;
		v[b]++;
		if(a == 0);{
			for (int i = 3; i <= 100; i++){
				if (v[i]%2 == 1){
					p = 1;
				}
			}
			if (p == 1) 
				cout << "NG" << endl;
			else 
				cout << "OK" << endl;
			v[] = {};
			p = 0;
		}
	}
}
					

Compiler output:
a.cc: In function 'int main()':
a.cc:19:27: error: expected primary-expression before ']' token
   19 |                         v[] = {};
      |                           ^
Language: C++

#include<cstdio>
#include<string>
#include<algorithm>
using namespace std;
int n, m, s, t = 0;
int d[110][110], used[110];

/*v????????¨??°???t????¨?????????????????????°*/
bool solve(int v,int count) {
	if (used[v] == 0) {
		used[v] == 1; count++;
	}
	if (d[v][2] > 0 && count == t - 1)return true;
	for (int u = 3; u <= t; u++) {
		if (v <= u&&d[v][u]>0) {
			d[v][u]--; if (solve(u, count)) return true;
		}
		else if (v > u&&d[u][v] > 0 ) {
			d[u][v]--; if (solve(u, count))return true;
			}
		}
	return false;
}

int main() {
	for (int i = 0; i < 110; i++) {
		used[110] = 0;
		for (int j = 0; j < 110; j++) {
			d[i][j] = 0;
		}
	}
	while (scanf_s("%d %d", &n, &m)) {
		if (n == 0 && m == 0)break;
		s = max(n, m);
		t = max(t, s);
		d[min(n, m)][s]++;
	}
	if (solve(1,1))printf("OK\n");
	else printf("NG\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   32 |         while (scanf_s("%d %d", &n, &m)) {
      |                ^~~~~~~
      |                scanf
Language: C++

#include<cstdio>
#include<string>
#include<algorithm>
using namespace std;
int n, m, s, t = 0;
int d[110][110], used[110];

/*v????????¨??°???t????¨?????????????????????°*/
bool solve(int v,int count) {
	if (used[v] == 0) {
		used[v] == 1; count++;
	}
	printf("%d", v);
	if (d[2][v] > 0 || d[v][2] > 0 && count == t - 1)return true;
	for (int u = 3; u <= t; u++) {
		if (v <= u&&d[v][u]>0) {
			d[v][u]--; if (solve(u, count)) return true;
		}
		else if (v > u&&d[u][v] > 0 ) {
			d[u][v]--; if (solve(u, count))return true;
			}
		}
	return false;
}

int main() {
	for (int i = 0; i < 110; i++) {
		used[110] = 0;
		for (int j = 0; j < 110; j++) {
			d[i][j] = 0;
		}
	}
	while (scanf_s("%d %d", &n, &m)) {
		if (n == 0 && m == 0)break;
		s = max(n, m);
		t = max(t, s);
		d[min(n, m)][s]++;
	}
	
	if (solve(1,1))printf("OK\n");
	else printf("NG\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   33 |         while (scanf_s("%d %d", &n, &m)) {
      |                ^~~~~~~
      |                scanf
Language: C++

#include<cstdio>
#include<string>
#include<algorithm>
using namespace std;
int n, m, s, t = 0;
int d[110][110], used[110];

/*v????????¨??°???t????¨?????????????????????°*/
bool solve(int v,int count) {
	if (used[v] == 0) {
		used[v] == 1; count++;
	}
	if (d[2][v] > 0 || d[v][2] > 0 && count == t - 1)return true;
	for (int u = 3; u <= t; u++) {
		if (v <= u&&d[v][u]>0) {
			d[v][u]--; if (solve(u, count)) return true;
		}
		else if (v > u&&d[u][v] > 0 ) {
			d[u][v]--; if (solve(u, count))return true;
			}
		}
	return false;
}

int main() {
	for (int i = 0; i < 110; i++) {
		used[110] = 0;
		for (int j = 0; j < 110; j++) {
			d[i][j] = 0;
		}
	}
	while (scanf_s("%d %d", &n, &m)) {
		if (n == 0 && m == 0)break;
		s = max(n, m);
		t = max(t, s);
		d[min(n, m)][s]++;
	}
	
	if (solve(1,1))printf("OK\n");
	else printf("NG\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   32 |         while (scanf_s("%d %d", &n, &m)) {
      |                ^~~~~~~
      |                scanf
Language: C++

#include<cstdio>
#include<string>
#include<algorithm>
using namespace std;
int n, m, s, t = 0;
int d[110][110], used[110];

/*v????????¨??°???t????¨?????????????????????°*/
bool solve(int v,int count) {
	if (used[v] == 0) {
		used[v] = 1; count++;
	}
	if (d[2][v] > 0 || d[v][2] > 0 && count == t - 1)return true;
	for (int u = 3; u <= t; u++) {
		if (v <= u&&d[v][u]>0) {
			d[v][u]--; if (solve(u, count)) return true;
		}
		else if (v > u&&d[u][v] > 0 ) {
			d[u][v]--; if (solve(u, count))return true;
			}
		}
	return false;
}

int main() {
	for (int i = 0; i < 110; i++) {
		used[110] = 0;
		for (int j = 0; j < 110; j++) {
			d[i][j] = 0;
		}
	}
	while (scanf_s("%d %d", &n, &m)) {
		if (n == 0 && m == 0)break;
		s = max(n, m);
		t = max(t, s);
		d[min(n, m)][s]++;
	}
	
	if (solve(1,1))printf("OK\n");
	else printf("NG\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   32 |         while (scanf_s("%d %d", &n, &m)) {
      |                ^~~~~~~
      |                scanf
Language: C++

#include<stdio.h>
int way[200];
int a,b;
int cou=0;
int main()
{
    while(scanf("%d%d",&a,&b)!=-1)
    {
        for(int i=0;i<200;i++)
        {
            way[i]=0;
        }
        cou=0;
        way[a]++;
        way[b]++;
        while(1)
        {
            scanf("%d%d",&a,&b);
            if(a==0&&b==0)break;
            way[a]++;
            way[b]++;
        }
        else if(way[1]%2==1&&way[2]%2==1)
        {
            cou=0;
            for(int i=3;i<200;i++)
            {
                if(way[i]%2!=0)break;
                cou++;
            }
            if(cou==197)printf("OK\n");
            else printf("NG\n");
        }
        else printf("NG\n");
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'else' without a previous 'if'
   23 |         else if(way[1]%2==1&&way[2]%2==1)
      |         ^~~~
Language: C++

#include "stdafx.h"
#include <algorithm> // sort ?????????
#include <string> // string (?????????) ?????????
#include<iostream>
using namespace std;
int N[256] = { 0 },a,b;
bool ok() {
	if (N[1] % 2 == 0)return false;
	if (N[2] % 2 == 0)return false;
	for (int i = 3; i < 256; i++) {
		if (N[i] % 2 == 1)return false;
	}
	return true;
}
int main() {
	while (cin >> a >> b) {
		N[a] += 1;
		N[b] += 1;
		if (a == 0 && b == 0) {
			if (ok)cout << "OK" << endl;
			else cout << "NG" << endl;
			for (int i = 0; i < 256; i++)N[i] = 0;
		}
	}
	return 0;
}

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

#include <iostream>
#include <string>
using namespace std;
 
int main(){
    while (true)
    {
        int x[200] = {};
        int a;
        cin >> a;
        if (cin.eof()) { break; }
        while (true)
        {
            x[a]++;
            x[a] = x[a] % 2;
            cin >> a;
            if (a == 0) { break; }
        }
        int count = 0;
        for(int i=1;i<101;i++){
            if (x[i] == 1) { count++; }
        }
        if(count ==0||count == 2){
            cout << "OK" << endl;
        }
        else{
            cout << "NG" << endl;
        }
    }
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:30:14: error: expected '}' at end of input
   30 |     return 0;
      |              ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int c[100];
int main() {
	int a, b;
	while (cin >> a >> b) {
		if (a == 0 && b == 0) {
			bool k = (c[0] % 2 == c[1] % 2);
			for (int i = 2; i < 100; i++) {
				if (c[i] & 1)k = false;
			}
			if (k)puts("OK");
			else puts("NG");
			memset(c, 0, sizeof(c));
		}
		else {
			a--; b--;
			c[a]++; c[b]++;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: 'memset' was not declared in this scope
   20 |                         memset(c, 0, sizeof(c));
      |                         ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<queue>
  +++ |+#include <cstring>
    7 | using namespace std;
Language: C++

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

int c[100];
int main() {
	int a, b;
	while (cin >> a >> b) {
		if (a == 0 && b == 0) {
			bool k = true;
			for (int i = 2; i < 100; i++) {
				if (c[i] & 1)k = false;
			}
			if (k)puts("OK");
			else puts("NG");
			memset(c, 0, sizeof(c));
		}
		else {
			a--; b--;
			c[a]++; c[b]++;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: 'memset' was not declared in this scope
   20 |                         memset(c, 0, sizeof(c));
      |                         ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<queue>
  +++ |+#include <cstring>
    7 | using namespace std;
Language: C++

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

int c[100];
int main() {
	int a, b;
	while (cin >> a >> b) {
		if (a == 0 && b == 0) {
			bool k = c[0] % 2 == 1 && c[1] % 2 == 1;
			for (int i = 2; i < 100; i++) {
				if (c[i] & 1)k = false;
			}
			if (k)puts("OK");
			else puts("NG");
			memset(c, 0, sizeof(c));
		}
		else {
			a--; b--;
			c[a]++; c[b]++;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: 'memset' was not declared in this scope
   20 |                         memset(c, 0, sizeof(c));
      |                         ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include<queue>
  +++ |+#include <cstring>
    7 | using namespace std;
Language: C++

#include<iostream>
using namespace std;
int map[110];
bool solve() {
	if (map[1] % 2 = 1 && map[2] % 2 == 1) {
		for (int i = 3; i <= 100; i++){
			if (map[i] % 2 == 1)
				return false;
		}
		return true;
	}
	else return false;
}
int main() {
	int a, b;
	while (cin >> a >> b) {
		if (!a && !b) {
			if (solve()) cout << "OK\n";
			else cout << "NG\n";
			for (int i = 1; i <= 100; i++)map[i] = 0;
			continue;
		}
		else {
			map[a]++;
			map[b]++;
		}
	}
}

Compiler output:
a.cc: In function 'bool solve()':
a.cc:5:20: error: lvalue required as left operand of assignment
    5 |         if (map[1] % 2 = 1 && map[2] % 2 == 1) {
      |             ~~~~~~~^~~
a.cc:13:1: warning: control reaches end of non-void function [-Wreturn-type]
   13 | }
      | ^
Language: C++

node = {}
readlines.map(&:chomp).each{|line|
  s, t = line.split.map(&:to_i)
  if s == 0 && t == 0
    if node[1] % 2 != node[2] % 2
      puts "NG"
    else
      node.delete(1)
      node.delete(2)
      cnt = 0

      node.each{|h, k|
        cnt += 1 if k % 2 == 1
      }
      if cnt == 0
        puts "OK"
      else
        puts "NG"
      end
    end
    node = {}
    next
  end
  node[s] ||= 0
  node[t] ||= 0
  node[s] += 1
  node[t] += 1
}

Compiler output:
a.cc:1:1: error: 'node' does not name a type
    1 | node = {}
      | ^~~~
a.cc:2:1: error: 'readlines' does not name a type
    2 | readlines.map(&:chomp).each{|line|
      | ^~~~~~~~~
Language: C++

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

int main(void){
  int i,a,b,flg,s[104];

  while(1){
    memset(s,0,sizeof(s));
    while(1){
      if(!(cin>>a>>b)) return 0;
      if(!a && !b) break;
      s[a]++;
      s[b]++;
    }

    flg = 0;
    if(s[1] % 2 == 1 && s[2] % 2 == 1){
      flg = 1;
    }

    for(i=3;i<104 && flg==1;i++){
      if(s[i] != 0 && s[i] % 2 == 1){
        flg = 0;
      }
    }

    if(flg){
      cout<<"OK\n";
    }
    else{
      cout<<"NG\n";
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'memset' was not declared in this scope
    9 |     memset(s,0,sizeof(s));
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

d[100],z[100]={1,1};main(a){for(;~scanf("%d 0",&a);)a--?(d[a]^=1):memset(d,0,400,puts(memcmp(d,z,400)?"NG":"OK"));}

Compiler output:
a.cc:1:1: error: 'd' does not name a type
    1 | d[100],z[100]={1,1};main(a){for(;~scanf("%d 0",&a);)a--?(d[a]^=1):memset(d,0,400,puts(memcmp(d,z,400)?"NG":"OK"));}
      | ^
a.cc:1:25: error: expected constructor, destructor, or type conversion before '(' token
    1 | d[100],z[100]={1,1};main(a){for(;~scanf("%d 0",&a);)a--?(d[a]^=1):memset(d,0,400,puts(memcmp(d,z,400)?"NG":"OK"));}
      |                         ^
Language: C++

#include<iostream>#include<cstdio>using namespace std;int main(){    for(;;){        int a,b,x = 0;        int field[100] = {0};        for(;;){            if(scanf("%d %d",&a,&b) == EOF){goto jump;}            if(!a && !b){break;}            field[a]++;            field[b]++;        }        for(int i=0; i<100; i++){            if(field[i]%2 == 1){x++;}        }        if(x == 2){cout <<"OK"<<endl;}        else{cout <<"NG"<<endl;}    }    jump:;    return 0;}

Compiler output:
a.cc:1:19: warning: extra tokens at end of #include directive
    1 | #include<iostream>#include<cstdio>using namespace std;int main(){    for(;;){        int a,b,x = 0;        int field[100] = {0};        for(;;){            if(scanf("%d %d",&a,&b) == EOF){goto jump;}            if(!a && !b){break;}            field[a]++;            field[b]++;        }        for(int i=0; i<100; i++){            if(field[i]%2 == 1){x++;}        }        if(x == 2){cout <<"OK"<<endl;}        else{cout <<"NG"<<endl;}    }    jump:;    return 0;}
      |                   ^
/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 <vector>
using namespace std;

int v[101];

int main(){
  int a, b;
  bool ng = false;
  while(cin >> a >> b){
    v[a]++, v[b]++;
    if(a == 0){
      if(v[1] + v[2] % 2 == 1){
	ng = true;
      }
      for(int i=3; i<101; ++i){
	if(v[i] % 2 == 1){
	  ng = true;
	}
      }
      if(ng){
	cout << "NG" << endl;
      } else { 
	cout << "OK" << endl;
      }
      memset(v, 0, sizeof(v));
    }
  }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:7: error: 'memset' was not declared in this scope
   26 |       memset(v, 0, sizeof(v));
      |       ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <cstdio>

using namespace std;

int main() {
  int a, b;
  int degree[5000] = {0};
  while (cin >> a, cin >> b) {
    if (a == -1 && b == -1) break;
    degree[a]++;
    degree[b]++;
    if (a == 0) {
      int flg = 0;
      for (int i = 0; i < 5000; i++)
        if (degree[i]%2 && i != 1 && i != 2) flg++;
      if (flg) cout << "NG" << endl;
      else cout << "OK" << endl;
      memset(degree, 0, sizeof(degree));
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:7: error: 'memset' was not declared in this scope
   19 |       memset(degree, 0, sizeof(degree));
      |       ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdio>
  +++ |+#include <cstring>
    3 |
Language: C++

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

const int MAX_NODE = 100;

int main() {
	int nodes[MAX_NODE + 1];
	int last = 0, from, to;
	memset(nodes, 0, sizeof(nodes));
	
	while (cin >> from >> to) {
		if (from == 0 && to == 0) {
			if ((nodes[1] & 1) && (nodes[2] & 1)
					&& all_of(nodes + 3, nodes + last + 1,
						[](int i){return !((i) & 1);})) {
				cout << "OK" << endl;
			}
			else {
				cout << "NG" << endl;
			}
			
			last = 0;
			memset(nodes, 0, sizeof(nodes));
		}
		else {
			nodes[from]++;
			nodes[to]++;
			last = max(last, max(from, to));
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:44: error: 'all_of' was not declared in this scope
   15 |                                         && all_of(nodes + 3, nodes + last + 1,
      |                                            ^~~~~~
Language: C++

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

int main(){

  while(!feof(stdin)){
    int G[1000]={0};
    int a,b;
    int mx = 0;

    while( cin >> a >> b , a+b ){
      G[b]++,G[a]++;
      mx = max(mx,max(a,b));
    }

    bool flag = true;
  
    for(int i = 3 ; i <= mx ; i++ ){
      if(G[i]%2 == 1 && G[i] != 0){
	flag = false;
	break;
      }
    }

    if( flag == true && G[1]%2 == 1 && G[2]%2 == 1) cout << "OK" << endl;
    else cout << "NG" << endl;
  }
}
  return 0;
}

Compiler output:
a.cc:30:3: error: expected unqualified-id before 'return'
   30 |   return 0;
      |   ^~~~~~
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C++

int main(){
	int x[101]={0},i,j;
	while(std::cin>>i>>j){
		x[1]++;
		x[2]++;
		while(i!=0&&j!=0){
			x[i]^=1;
			x[j]^=1;
			std::cin>>i>>j;
		}
		for(i=0;i<101;i++)if(x[i])break;
		std::cout<<(i==101?"OK\n":"NG\n");
		for(i=0;i<101;i++)x[i]=0;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:20: error: 'cin' is not a member of 'std'
    3 |         while(std::cin>>i>>j){
      |                    ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(){
a.cc:9:30: error: 'cin' is not a member of 'std'
    9 |                         std::cin>>i>>j;
      |                              ^~~
a.cc:9:30: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:22: error: 'cout' is not a member of 'std'
   12 |                 std::cout<<(i==101?"OK\n":"NG\n");
      |                      ^~~~
a.cc:12:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

//include
//------------------------------------------
#include <bits/stdc++.h> // only for GCC
 
using namespace std;
 
//typedef
//------------------------------------------
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;
 
//container util
//------------------------------------------
#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
 
//repetition
//------------------------------------------
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)
 
//constant
//--------------------------------------------
const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;
 
// output vector
// ------------------------------------------
namespace std {
    template<typename T>ostream&operator<<(ostream&os, vector<T>const&v){
        iter(it,v) os<<*it<<(it+1==v.end()?"":",");
        return os;
    }
    template<typename T, typename U>ostream&operator<<(ostream&os,const pair<T,U>&p){
        return os << "[" << p.dirst << "," << p.second << "]";
    }
}
 
//clear memory
// ------------------------------------------
#define clr(a,i) memset((a), (i) ,sizeof(a))
 
int main(){
   int n,m;
   vi a(101,0);
   while(cin>>n>>m){
      if(n+m==0){
         if(a[1]%2==0||) cout << "OK" << endl;
         else cout<<(count_if(all(a),[](int x){return x%2==1;})==2?"OK":"NG")<<endl;
         fill(all(a),0);
         continue;
      }
      a[n]++; a[m]++;
   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:24: error: expected primary-expression before ')' token
   59 |          if(a[1]%2==0||) cout << "OK" << endl;
      |                        ^
Language: C++

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

int dim[e+10];

void init() {
  fill(dim, dim+110, 0);
}

bool hitofude() {
  if ((dim[1]+dim[2])%2) {
    return false;
  }
  for (int i=3; i<e+10; i++) {
    if (dim[i]%2) {
      return false;
    }
  }
  return true;
}

int main() {
  int a,b;
  init();
  while (scanf("%d%d", &a, &b)!=EOF) {
    dim[a]++;
    dim[b]++;
    if (a==0 && b==0) {
      if (hitofude()) {
	printf("OK\n");
      } else {
	printf("NG\n");
      }
      init();
    }
  }
}

Compiler output:
a.cc:5:9: error: 'e' was not declared in this scope
    5 | int dim[e+10];
      |         ^
a.cc: In function 'void init()':
a.cc:8:8: error: 'dim' was not declared in this scope; did you mean 'div'?
    8 |   fill(dim, dim+110, 0);
      |        ^~~
      |        div
a.cc: In function 'bool hitofude()':
a.cc:12:8: error: 'dim' was not declared in this scope; did you mean 'div'?
   12 |   if ((dim[1]+dim[2])%2) {
      |        ^~~
      |        div
a.cc:15:19: error: 'e' was not declared in this scope
   15 |   for (int i=3; i<e+10; i++) {
      |                   ^
a.cc:16:9: error: 'dim' was not declared in this scope; did you mean 'div'?
   16 |     if (dim[i]%2) {
      |         ^~~
      |         div
a.cc: In function 'int main()':
a.cc:27:5: error: 'dim' was not declared in this scope; did you mean 'div'?
   27 |     dim[a]++;
      |     ^~~
      |     div
Language: Java

import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;

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

public class Main{

	Scanner sc;

	static final int INF=1<<28;
	static final double EPS=1e-9;

	void run(){
		sc=new Scanner(System.in);
		for(; sc.hasNext();){
			Scanner c=new Scanner(sc.nextLine());
			Stack<Double> stack=new Stack<Double>();
			for(; c.hasNext();){
				String s=c.next();
				/*if(Character.isDigit(s.charAt(0))){
					stack.push(Double.parseDouble(s));
				}else{
					double d2=stack.pop();
					double d1=stack.pop();
					double d=0;
					switch(s.charAt(0)){
					case '+':
						d=d1+d2;
						break;
					case '-':
						d=d1-d2;
						break;
					case '*':
						d=d1*d2;
						break;
					case '/':
						d=d1/d2;
						break;
					}
					stack.push(d);
				}*/
			}
			double ans=stack.pop();
			println(ans+"");*/
			println("");
		}
		sc.close();
	}

	void print(String s){
		System.out.print(s);
	}

	void println(String s){
		System.out.println(s);
	}

	public static void main(String[] args){
		new Main().run();
	}
}

Compiler output:
Main.java:47: error: illegal start of expression
			println(ans+"");*/
			                ^
Main.java:47: error: illegal start of expression
			println(ans+"");*/
			                 ^
2 errors
Language: Java

import java.util.Scanner;
import java.util.Stack;
 
public class Main {
     
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
         
        while(sc.hasNextLine()){
            Stack<Double> stack = new Stack<Double>();

            for(String s : sc.nextLine().split(" ");){
                if(s.equals("+")){
                    double d2 = stack.pop();
                    double d1 = stack.pop();
                    stack.push(d1 + d2);
                }else if(s.equals("-")){
                    double d2 = stack.pop();
                    double d1 = stack.pop();
                    stack.push(d1 - d2);
                }else if(s.equals("*")){
                    double d2 = stack.pop();
                    double d1 = stack.pop();
                    stack.push(d1 * d2);
                }else if(s.equals("/")){
                    double d2 = stack.pop();
                    double d1 = stack.pop();
                    stack.push(d1 / d2);
                }else{
                    stack.push(Double.parseDouble(s));
                }
            }
             
            System.out.println(stack.pop());
        }
         
    }
     
}

Compiler output:
Main.java:12: error: ')' expected
            for(String s : sc.nextLine().split(" ");){
                                                   ^
Main.java:12: error: illegal start of expression
            for(String s : sc.nextLine().split(" ");){
                                                    ^
2 errors
Language: C

#define _CRT_SECURE_NO_WARNINGS
////#define _USE_MATH_DEFINES
#include<stdio.h>
#include<stdlib.h>
//#include<math.h>
#include<string.h>
//#include<time.h>
#define P(type,x) fprintf(stdout,"%"#type"\n",x)
void push(double, int, double[]);
double pop(int, double[]);

int main() {
	char array[1000000];
	char *pt = array, *tok;
	int top = 0;
	double result[1000],num, a, b;
	while (~scanf("%[^\n]*s", pt) != NULL) {
		getchar();
		memset(result, 0.0, sizeof(result));
		tok = strtok(pt, " ");
		while (tok != NULL) {
			if (*tok == '+') {
				a = pop(--top, result);
				b = pop(--top, result);
				push(a + b, top++, result);
			}

			else if (*tok == '-') {
				b = pop(--top, result);
				a = pop(--top, result);
				push(a - b, top++, result);
			}

			else if (*tok == '*') {
				a = pop(--top, result);
				b = pop(--top, result);
				push(a * b, top++, result);
			}

			else if (*tok == '/') {
				a = pop(--top, result);
				b = pop(--top, result);
				push(a / b, top++, result);
			}

			else {
				num = atof(tok);
				push(num, top++, result);
			}
			tok = strtok(NULL, " ");
		}
		printf("%lf\n", pop(--top, result));
		memset(array, '\0', sizeof(array));
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:39: warning: comparison between pointer and integer
   17 |         while (~scanf("%[^\n]*s", pt) != NULL) {
      |                                       ^~
/usr/bin/ld: /tmp/ccfhJUNv.o: in function `main':
main.c:(.text+0x7e): undefined reference to `pop'
/usr/bin/ld: main.c:(.text+0x9f): undefined reference to `pop'
/usr/bin/ld: main.c:(.text+0xd6): undefined reference to `push'
/usr/bin/ld: main.c:(.text+0xfe): undefined reference to `pop'
/usr/bin/ld: main.c:(.text+0x11f): undefined reference to `pop'
/usr/bin/ld: main.c:(.text+0x156): undefined reference to `push'
/usr/bin/ld: main.c:(.text+0x17e): undefined reference to `pop'
/usr/bin/ld: main.c:(.text+0x19f): undefined reference to `pop'
/usr/bin/ld: main.c:(.text+0x1d6): undefined reference to `push'
/usr/bin/ld: main.c:(.text+0x1fe): undefined reference to `pop'
/usr/bin/ld: main.c:(.text+0x21f): undefined reference to `pop'
/usr/bin/ld: main.c:(.text+0x256): undefined reference to `push'
/usr/bin/ld: main.c:(.text+0x290): undefined reference to `push'
/usr/bin/ld: main.c:(.text+0x2cb): undefined reference to `pop'
collect2: error: ld returned 1 exit status
Language: C

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

void push(double S[],int *top,double x){

 S[(*top)]=x;
 (*top)++;

return;
}

double pop(double S[],int *top){

 (*top)--;
 return S[(*top)];

}

int main(){
 char str[81];
 int i,j;
 int R,top;
 char temp[10];
 double S[80];
 double x1,x2;

 while(fgets(str,sizeof str,stdin)!=NULL){

   R=strlen(str);
   j=0; i=0; top=0;

   while(i<=R){

     if(i<R && str[i]!=' ')temp[j++]=str[i++];
     else {

       temp[j]='\0';

       if(isdigit(temp[0]))
          push(S,&top,atof(temp));
       else if( !isdigit(temp[0]) && isdigit(temp[1]) )
          push(S,&top,atof(temp));/*負の数*/
       else {
          x1=pop(S,&top);
          x2=pop(S,&top);
          switch(temp[0]){
            case '+':push(S,&top,x2+x1);
                     break;
            case '-':push(S,&top,x2-x1);
                     break;
            case '*':push(S,&top,x2*x1);
                     break;
            case '/':push(S,&top,x2/x1);
                     break;
          }
　　　 i++;
       }

       j=0;

     }


   }
   printf("%.6lf\n",S[0]);

 }


return 0;
}


Compiler output:
main.c: In function 'main':
main.c:58:1: error: stray '\343' in program
   58 | <U+3000><U+3000><U+3000> i++;
      | ^~~~~~~~
main.c:58:3: error: stray '\343' in program
   58 | <U+3000><U+3000><U+3000> i++;
      |         ^~~~~~~~
main.c:58:5: error: stray '\343' in program
   58 | <U+3000><U+3000><U+3000> i++;
      |                 ^~~~~~~~
Language: C

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

int main(void) {
	double stack[200];
	char temp[100];
	int stackptr=0;
	while(1) {
		if(scanf("%s",temp)==-1)break;
		assert(stackptr >= 2);
		if(temp[0]=='+') {
			if(stackptr<2)return 1;
			stack[stackptr-2]+=stack[stackptr-1];
			stackptr--;
		} else if(temp[0]=='-') {
			if(stackptr<2)return 1;
			stack[stackptr-2]-=stack[stackptr-1];
			stackptr--;
		} else if(temp[0]=='*') {
			if(stackptr<2)return 1;
			stack[stackptr-2]*=stack[stackptr-1];
			stackptr--;
		} else if(temp[0]=='/') {
			if(stackptr<2)return 1;
			if(stack[stackptr-1]==0)return 1;
			stack[stackptr-2]/=stack[stackptr-1];
			stackptr--;
		} else {
			stack[stackptr]=atof(temp);
			stackptr++;
		}
		if(getchar()=='\n') {
			if(stackptr!=1)return 1;
			printf("%f\n",stack[0]);
			stackptr=0;
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:17: error: implicit declaration of function 'assert' [-Wimplicit-function-declaration]
   10 |                 assert(stackptr >= 2);
      |                 ^~~~~~
main.c:3:1: note: 'assert' is defined in header '<assert.h>'; this is probably fixable by adding '#include <assert.h>'
    2 | #include <stdlib.h>
  +++ |+#include <assert.h>
    3 |
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
double plus( double a, double b )
{
	return a + b;
}
double minus( double a, double b )
{
	return a - b;
}
double product( double a, double b )
{
	return a * b;
}
double divide( double a, double b )
{
	return a / b;
}
double (*calculation[4])() = {plus, minus, product, divide};
void rpn( char *t, double stack[], int *stack_ptr )
{
	char strOperator[] = "+\0-\0*\0/";
	int i;
	for( i = 0;i < 4;i++ ) if( strcmp( &strOperator[i * 2], t ) == 0 ) break;
	if( i != 4 ){
		(*stack_ptr)--;
		stack[*stack_ptr - 1] = ( *calculation[i] )( stack[*stack_ptr - 1], stack[*stack_ptr] );
	} else {
		stack[ (*stack_ptr)++ ] = atof( t );
	}
}
int main(void)
{
	char str[81],*t;
	double stack[81];
	int i,stack_ptr;
	while( 1 ){
		gets( str );
		if( strcmp( str, "0" ) == 0 ) break;
		for( i = 0;i < 81;i++ ){
			stack[i] = 0;
		}
		stack_ptr = 0;
		t = strtok( str, " " );
		rpn( t, stack, &stack_ptr );
		while( ( t = strtok( NULL, " ") ) != NULL ){
			rpn( t, stack, &stack_ptr );
		}
		printf("%f\n", stack[0] );
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:39:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   39 |                 gets( str );
      |                 ^~~~
      |                 fgets
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string>
int main()
{
	char c,d[11];
	double s[80];
	int p=-1,q=0,t;
	while(scanf("%c",&c)!=EOF)
	{
		switch(c)
		{
		case '+':
			t=s[p-1]+s[p];
			goto j;
		case '-':
			scanf("%c",&c);
			if('1'>c||'0'<c)
			{
				t=s[p-1]-s[p];
				goto j;
			}
			if(c=='\n')
				goto k;
			d[q++]='-';
			d[q++]=c;
			break;
		case '*':
			t=s[p-1]*s[p];
			goto j;
		case '/':
			t=s[p-1]/s[p];
j:			s[--p]=t;
			break;
		case '\n':
			if(d[0]!=0)
				s[0]=atof(d);
			printf("%lf\n",s[0]);
			p=-1;
			q=0;
			break;
		case ' ':
k:			if(q!=0)
			{
				s[++p]=atof(d);
				memset(d,NULL,11);
				q=0;
			}
			break;
		default:
			d[q++]=c;
		}
	}
	return 0;
}

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

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

double eval(double a, double b, char oper){
    if( oper == '+' ) return a+b;
    if( oper == '-' ) return a-b;
    if( oper == '*' ) return a*b;
    if( oper == '/' ) return a/b;
    return 0;
}

int main(){
    char expr[100];
    char* it;
    while( fgets(expr, 100, stdin) ){
        stack<double> stk;
        double ans = 0;
        it = strtok(expr, " ");
        stk.push( atoi(it) );        
        while( true ){
            it = strtok(NULL, " ");
            if( it == NULL ) break;
            if( isdigit( *it ) ){
                stk.push( atoi(it) );
            }else{
                int a, b;
                a = stk.top();
                stk.pop();
                b = stk.top();
                stk.pop();
                stk.push( eval(b, a, *it) );
            }
        }
        printf("%lf\n", stk.top() );
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:19: error: 'atoi' was not declared in this scope
   22 |         stk.push( atoi(it) );
      |                   ^~~~
Language: C++

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

double eval(double a, double b, char oper){
    if( oper == '+' ) return a+b;
    if( oper == '-' ) return a-b;
    if( oper == '*' ) return a*b;
    if( oper == '/' ) return a/b;
    return 0;
}

int main(){
    char expr[100];
    char* it;
    while( fgets(expr, 100, stdin) ){
        stack<double> stk;
        it = strtok(expr, " ");
        stk.push( atoi(it) );        
        while( true ){
            it = strtok(NULL, " ");
            if( it == NULL ) break;
            if( isdigit( *it ) ){
                stk.push( atoi(it) );
            }else{
                int a, b;
                a = stk.top();
                stk.pop();
                b = stk.top();
                stk.pop();
                stk.push( eval(b, a, *it) );
            }
        }
        printf("%lf\n", stk.top() );
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:19: error: 'atoi' was not declared in this scope
   21 |         stk.push( atoi(it) );
      |                   ^~~~
Language: C++

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

double eval(double a, double b, char oper){
    if( oper == '+' ) return a+b;
    if( oper == '-' ) return a-b;
    if( oper == '*' ) return a*b;
    if( oper == '/' ) return a/b;
    return 0;
}

int main(){
    char expr[100];
    char* it;
    while( fgets(expr, 100, stdin) ){
        stack<double> stk;
        it = strtok(expr, " ");
        stk.push( (double)atoi(it) );
        while( true ){
            it = strtok(NULL, " ");
            if( it == NULL ) break;
            if( isdigit( *it ) ){
                stk.push( (double)atoi(it) );
            }else{
                int a, b;
                a = stk.top();
                stk.pop();
                b = stk.top();
                stk.pop();
                stk.push( eval(b, a, *it) );
            }
        }
        printf("%lf\n", stk.top() );
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:27: error: 'atoi' was not declared in this scope
   21 |         stk.push( (double)atoi(it) );
      |                           ^~~~
Language: C++

#include <cstdio>
#include <cctype>
#include <stdlib>
#include <cstring>
#include <stack>
using namespace std;

double eval(double a, double b, char oper){
    if( oper == '+' ) return a + b;
    if( oper == '-' ) return a - b;
    if( oper == '*' ) return a * b;
    if( oper == '/' ) return a / b;
    return 0.0;
}

int main(){
    char expr[100];
    char* it;
    while( fgets(expr, 100, stdin) ){
        stack<double> stk;
        it = strtok(expr, " ");
        stk.push( (double)atoi(it) );
        while( true ){
            it = strtok(NULL, " ");
            if( it == NULL ) break;
            if( isdigit( *it ) ){
                stk.push( (double)atoi(it) );
            }else{
                int a, b;
                a = stk.top();
                stk.pop();
                b = stk.top();
                stk.pop();
                stk.push( eval(b, a, *it) );
            }
        }
        printf("%lf\n", stk.top() );
    }
    return 0;
}

Compiler output:
a.cc:3:10: fatal error: stdlib: No such file or directory
    3 | #include <stdlib>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<stack>

using namespace std;

double s_d(string a){
	double b=0;
	double zy=0.1;
	bool hu=false;
	bool dot=false;
	for(int i=0;i<a.size();i++){
		if(dot){
			b+=zy*(a[i]-'0');
			zy*=0.1;
		}
		else if(a[i]=='-') hu=true;
		else if(a[i]=='.'){
			dot=true;
		}
		else{
			b*=10;
			b+=a[i]-'0';
		}
	}

	if(hu) b*=-1;
	return b;
}

int main(){

	stack<string> siki;
	stack<double> bnum;
	string nums="";
	double a,b,c;
	char in;

	while(cin>>nums){
		siki.push(nums);
		nums="";
		while(1){
			in=getchar();
			if(in=='*'||in=='-'||in=='/'||in=='+'){
				if(siki.top()=="?"){
					b=bnum.top();
					bnum.pop();
					siki.pop();
				}
				else{
					b=s_d(siki.top());
					siki.pop();
				}
				if(siki.top()=="?"){
					a=bnum.top();
					bnum.pop();
					siki.pop();
				}
				else{
					a=s_d(siki.top());
					siki.pop();
				}
				if(in=='*') c=a*b;
				else if(in=='+') c=a+b;
				else if(in=='-') c=a-b;
				else if(in=='/') c=a/b;
				siki.push("?");
				bnum.push(c);
			}
			else if(in==' '){
				if(!nums.empty()){
					siki.push(nums);
					nums="";
				}
			}
			else if(in=='\n'){
				break;
			}
			else{
				nums+=in;
			}
		}
		
	}

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

#include <iostream>
#include <sstream>
#include <string>
#include <stack>
#include <stdlib.h>
using namespace std;

int main()
{
    string s;
    while(getline(cin, s))
    {
        stringstream ss;
        ss << s;
        stack<double> st;
        while(ss >> s)
        {
            if((s[0] >= '0' && s[0] <= '9') || s.size() > 1)
            {
                st.push(atoi(s.c_str()));
            }
            else
            {
                double a, b, x;
                b = st.top();
                st.pop();
                a = st.top();
                st.pop();
                if(strcmp(s.c_str(), "+") == 0)
                    x = a+b;
                else if(strcmp(s.c_str(), "-") == 0)
                    x = a-b;
                else if(strcmp(s.c_str(), "/") == 0)
                    x = a/b;
                else if(strcmp(s.c_str(), "*") == 0)
                    x = a*b;
                st.push(x);
                
            }
        }
        double result = st.top();
        cout << result << endl;
        
        
        
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:20: error: 'strcmp' was not declared in this scope
   29 |                 if(strcmp(s.c_str(), "+") == 0)
      |                    ^~~~~~
a.cc:6:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <stdlib.h>
  +++ |+#include <cstring>
    6 | using namespace std;
Language: C++

#include<iostream>
#include<cstdlib>
#include<stack>
#include<string>
#include<cctype>
#include<sstream>
using namespace std;
int main(){
    string str;
    while(getline(cin,s)){
        stack<double>S;
        stringstream ss
        ss<<s;
        while(ss>>s){
            if(isdigit(str[0])){
                double d=(double)atoi(str.c_str());
                S.push(d);
            }
            else{
                char ope=str[0];
                int d1=S.top();S.pop();
                int d2=S.top();S.pop();
                if(ope=='+')S.push(d1+d2);
                else if(ope=='-')S.push(d2-d1);
                else if(ope=='*')S.push(d1*d2);
                else S.push(d2/d1);
            }
        }
        cout<<fixed<<S.top()<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: 's' was not declared in this scope
   10 |     while(getline(cin,s)){
      |                       ^
a.cc:13:9: error: expected initializer before 'ss'
   13 |         ss<<s;
      |         ^~
a.cc:14:15: error: 'ss' was not declared in this scope
   14 |         while(ss>>s){
      |               ^~
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);
		rep(i,len) {
			if(str[i] == ' ') {
				if(isdigit(t[0])) {
					double n = atof(t.c_str());
					s.push(n);
				} else {
					if(t == "+") {
						double a = s.top(); s.pop();
						double b = s.top(); s.pop();
						double c = a + b;
						s.push(c);
					}
					if(t == "-") {
						double a = s.top(); s.pop();
						double b = s.top(); s.pop();
						double c = b - a;
						s.push(c);
					}
					if(t == "*") {
						double a = s.top(); s.pop();
						double b = s.top(); s.pop();
						double c = a * b;
						s.push(c);
					}
					if(t == "/") {
						double a = s.top(); s.pop();
						double b = s.top(); s.pop();
						double 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;