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

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

int main() {
	int n, i, j, k,c,d,e,f;
	c = 0;
	d = 0;
	char a[100], b[100];
	cin >> n;
	for (i = 0; i < n; i++) {
		k = 0;
		e = 0;
		f = 0;
		for (j = 0; j < 100; j++) {
			scanf_s("%c", &a[j]);
			e++;
			if (a[j] == ' ')break;
		}
		for (j = 0; j < 100; j++) {
			scanf_s("%c", &b[j]);
			f++;
			if (b[j] == '\n')break;
		}
		if (e < f) {
			for (j = 0; j < e; j++) {
				if (a[j] < b[j]) {
					c += 3;
					k = 1;
					break;
				}
				if (a[j] > b[j]) {
					d += 3;
					k = 1;
					break;
				}
			}
			if (k == 0) {
				d += 3;
			}
		}
		if (e >= f) {
			for (j = 0; j < f; j++) {
				if (a[j] < b[j]) {
					c += 3;
					k = 1;
					break;
				}
				if (a[j] > b[j]) {
					d += 3;
					k = 1;
					break;
				}
			}
			if (k == 0) {
				if (e > f) {
					c += 3;
				}
				else {
					c++; 
					d++;
				}
			}
		}
		
	}
	cout << c << " " << d << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   16 |                         scanf_s("%c", &a[j]);
      |                         ^~~~~~~
      |                         scanf
a.cc:21:25: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   21 |                         scanf_s("%c", &b[j]);
      |                         ^~~~~~~
      |                         scanf
Language: C++

#include<iostream>
#include<string>

int main(){
     int taro,hanako,n;
     string animalt,animalh;
     cin>>n;
     for(int i=0;i=n;i++){
          cin>>animalt>>animalh;
          if(animalt[0]>animalh[0]) taro++
          if(animalh[0]<animalh[0]) hanako++
          }
     cout<<taro<<" "<<hanako<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: 'string' was not declared in this scope
    6 |      string animalt,animalh;
      |      ^~~~~~
a.cc:6:6: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:6: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |      cin>>n;
      |      ^~~
      |      std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:16: error: 'animalt' was not declared in this scope
    9 |           cin>>animalt>>animalh;
      |                ^~~~~~~
a.cc:9:25: error: 'animalh' was not declared in this scope
    9 |           cin>>animalt>>animalh;
      |                         ^~~~~~~
a.cc:10:43: error: expected ';' before 'if'
   10 |           if(animalt[0]>animalh[0]) taro++
      |                                           ^
      |                                           ;
   11 |           if(animalh[0]<animalh[0]) hanako++
      |           ~~                               
a.cc:13:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |      cout<<taro<<" "<<hanako<<endl;
      |      ^~~~
      |      std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |      cout<<taro<<" "<<hanako<<endl;
      |                               ^~~~
      |                               std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main(){
     int taro,hanako,n;
     string animalt,animalh;
     cin>>n;
     for(int i=0;i=n;i++){
          cin>>animalt>>animalh;
          if(animalt[0]>animalh[0]) taro++
          if(animalh[0]<animalh[0]) hanako++
          }
     cout<<taro<<" "<<hanako<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:43: error: expected ';' before 'if'
   11 |           if(animalt[0]>animalh[0]) taro++
      |                                           ^
      |                                           ;
   12 |           if(animalh[0]<animalh[0]) hanako++
      |           ~~
Language: C++

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

int main(){
     int taro,hanako,n;
     string animalt,animalh;
     cin>>n;
     for(int i=0;i=n;i++){
          cin>>animalt>>animalh;
          if(animalt[0]>animalh[0]) taro=+=3;
          else if(animalh[0]<animalh[0]) hanako=+=3;
          }else{
          taro++;
          hanako++
          }
     cout<<taro<<" "<<hanako<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:42: error: expected primary-expression before '+=' token
   11 |           if(animalt[0]>animalh[0]) taro=+=3;
      |                                          ^~
a.cc:12:49: error: expected primary-expression before '+=' token
   12 |           else if(animalh[0]<animalh[0]) hanako=+=3;
      |                                                 ^~
a.cc:13:12: error: 'else' without a previous 'if'
   13 |           }else{
      |            ^~~~
a.cc:15:19: error: expected ';' before '}' token
   15 |           hanako++
      |                   ^
      |                   ;
   16 |           }
      |           ~
Language: C++

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

int main(){
     int taro,hanako,n;
     string animalt,animalh;
     cin>>n;
     for(int i=0;i=n;i++){
          cin>>animalt>>animalh;
          if(animalt[0]>animalh[0]) taro+=3;
          else if(animalh[0]<animalh[0]) hanako+=3;
          }else{
          taro++;
          hanako++
          }
     cout<<taro<<" "<<hanako<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 'else' without a previous 'if'
   13 |           }else{
      |            ^~~~
a.cc:15:19: error: expected ';' before '}' token
   15 |           hanako++
      |                   ^
      |                   ;
   16 |           }
      |           ~
Language: C++

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

int main(){
     int taro,hanako,n;
     string animalt,animalh;
     cin>>n;
     for(int i=0;i=n;i++){
          cin>>animalt>>animalh;
          if(animalt[0]>animalh[0]) taro+=3;
          else if(animalh[0]<animalh[0]) hanako+=3;
          }else if(animalh[0]=animalt[0]{
          taro++;
          hanako++
          }
     cout<<taro<<" "<<hanako<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 'else' without a previous 'if'
   13 |           }else if(animalh[0]=animalt[0]{
      |            ^~~~
a.cc:13:41: error: expected ';' before '{' token
   13 |           }else if(animalh[0]=animalt[0]{
      |                                         ^
      |                                         ;
a.cc:17:35: error: expected ')' before ';' token
   17 |      cout<<taro<<" "<<hanako<<endl;
      |                                   ^
      |                                   )
a.cc:13:19: note: to match this '('
   13 |           }else if(animalh[0]=animalt[0]{
      |                   ^
Language: C++

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

int main(){
     int taro,hanako,n;
     string animalt,animalh;
     cin>>n;
     for(int i=0;i=n;i++){
          cin>>animalt>>animalh;
          if(animalt[0]>animalh[0]) taro+=3;
          else if(animalh[0]<animalh[0]) hanako+=3;
          else if(animalh[0]=animalt[0]{
          taro++;
          hanako++
          }
     cout<<taro<<" "<<hanako<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:40: error: expected ';' before '{' token
   13 |           else if(animalh[0]=animalt[0]{
      |                                        ^
      |                                        ;
a.cc:17:35: error: expected ')' before ';' token
   17 |      cout<<taro<<" "<<hanako<<endl;
      |                                   ^
      |                                   )
a.cc:13:18: note: to match this '('
   13 |           else if(animalh[0]=animalt[0]{
      |                  ^
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int main(){
     int taro,hanako,n;
     string animalt,animalh;
     cin>>n;
     for(int i=0;i=n;i++){
          cin>>animalt>>animalh;
          if(animalt[0]>animalh[0]) taro+=3;
          else if(animalh[0]<animalh[0]) hanako+=3;
          else if(animalh[0]=animalt[0]){
          taro++;
          hanako++
          }
     cout<<taro<<" "<<hanako<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: expected ';' before '}' token
   15 |           hanako++
      |                   ^
      |                   ;
   16 |           }
      |           ~        
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int main(){
     int taro,hanako,n;
     string animalt,animalh;
     cin>>n;
     for(int i=0;i=n;i++){
          cin>>animalt>>animalh;
          if(animalt[0]>animalh[0]) taro+=3;
          else if(animalh[0]<animalh[0]) hanako+=3;
          else if(animalh[0]=animalt[0]){
          taro++;
          hanako++;
          }
     cout<<taro<<" "<<hanako<<endl;
}

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

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

int main(){
     int taro,hanako,n;
     string animalt,animalh;
     cin>>n;
     for(int i=0;i<n;i++){
          cin>>animalt>>animalh;
          if(animalt[0]>animalh[0]) taro+=3;
          else if(animalh<animalt) hanako+=3;
          else if(animalh=animalt){
          taro++;
          hanako++;
          }
      }
     cout<<taro<<" "<<hanako<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:26: error: could not convert 'animalh.std::__cxx11::basic_string<char>::operator=(animalt)' from 'std::__cxx11::basic_string<char>' to 'bool'
   13 |           else if(animalh=animalt){
      |                   ~~~~~~~^~~~~~~~
      |                          |
      |                          std::__cxx11::basic_string<char>
Language: C++

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

int main(void) {
    int N, diff, taroScore, hanakoScore;
    char taro[101], hanako[101];
    scanf("%d", &N);

    taroScore = 0; hanakoScore = 0;
    while(N-- > 0) {
        scanf("%s %s", taro, hanako);
        diff = strcmp(taro, hanako);
        if(diff == 0) taroScore++, hanakoScore++;
        if(diff > 0) taroScore += 3;
        if(diff < 0) hanakoScore += 3;
    }
    printf("%d %d\n", taroScore, hanakoScore);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'strcmp' was not declared in this scope
   13 |         diff = strcmp(taro, hanako);
      |                ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <stdio.h>
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
	int n,i,t,k;
	string taro,hanako;
	cin >> n;
	for(i=0;i<n;i++){
		cin >> taro >> hanako;
		if(taro == hanako){
			t++;
			h++;
		}
		else if(taro > hanako){
			t+=3;
		}
		else {h+=3;}
	}
	cout << t << " " << h << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:25: error: 'h' was not declared in this scope
   14 |                         h++;
      |                         ^
a.cc:19:23: error: 'h' was not declared in this scope
   19 |                 else {h+=3;}
      |                       ^
a.cc:21:29: error: 'h' was not declared in this scope
   21 |         cout << t << " " << h << endl;
      |                             ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
	int n,i,t,k;
	string taro,hanako;
	cin >> n;
	for(i=0;i<ntaro >> hanako;
		if(taro == hanako){
			t++;
			h+;i++){
		cin >> +;
		}
		else if(taro > hanako){
			t+=3;
		}
		else {h+=3;}
	}
	cout << t << h << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: 'ntaro' was not declared in this scope; did you mean 'taro'?
   10 |         for(i=0;i<ntaro >> hanako;
      |                   ^~~~~
      |                   taro
a.cc:11:17: error: expected primary-expression before 'if'
   11 |                 if(taro == hanako){
      |                 ^~
a.cc:10:35: error: expected ')' before 'if'
   10 |         for(i=0;i<ntaro >> hanako;
      |            ~                      ^
      |                                   )
   11 |                 if(taro == hanako){
      |                 ~~                 
a.cc:13:25: error: 'h' was not declared in this scope
   13 |                         h+;i++){
      |                         ^
a.cc:13:27: error: expected primary-expression before ';' token
   13 |                         h+;i++){
      |                           ^
a.cc:13:31: error: expected ';' before ')' token
   13 |                         h+;i++){
      |                               ^
      |                               ;
a.cc:16:17: error: expected '}' before 'else'
   16 |                 else if(taro > hanako){
      |                 ^~~~
a.cc:11:35: note: to match this '{'
   11 |                 if(taro == hanako){
      |                                   ^
a.cc:19:23: error: 'h' was not declared in this scope
   19 |                 else {h+=3;}
      |                       ^
a.cc: At global scope:
a.cc:21:9: error: 'cout' does not name a type
   21 |         cout << t << h << endl;
      |         ^~~~
a.cc:22:9: error: expected unqualified-id before 'return'
   22 |         return 0;
      |         ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
	int n,i,t,k;
	string taro,hanako;
	cin >> n;
	for(i=0;i<n;i++){
		cin >> taro >> hanako;
		if(taro == hanako){
			t++;
			h++;
		}
		else if(taro > hanako){
			t+=3;
		}
		else {h+=3;}
	}
	cout << t << h << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:25: error: 'h' was not declared in this scope
   14 |                         h++;
      |                         ^
a.cc:19:23: error: 'h' was not declared in this scope
   19 |                 else {h+=3;}
      |                       ^
a.cc:21:22: error: 'h' was not declared in this scope
   21 |         cout << t << h << endl;
      |                      ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(int argc, char *argv[]){
	int n;
	cin >> n;
	string s_hanako, s_taro;
	int p_hanako = 0;
	int p_taro = 0;
	for(int i = 0; i < n; i++){
		cin >> s_taro >> s_hanako;
		if (s_taro == s_hanako){
			p_hanako += 1;
			p_taro += 1;
		} else if (s_taro < s_hanako) {
			p_hanako += 3;
		} else if (s_taro > s_hanako) {
			p_taro += 3;
		}
	}
	cout << p_tar << " " << p_hanako << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:23:17: error: 'p_tar' was not declared in this scope; did you mean 'p_taro'?
   23 |         cout << p_tar << " " << p_hanako << endl;
      |                 ^~~~~
      |                 p_taro
Language: C++

n = int(input())

score_taro, score_hanako = 0, 0
for _ in range(n):
    card_taro, card_hanako = input().split()

    point_taro, point_hanako = 0, 0
    if card_taro == card_hanako:
        score_taro = 1
        score_hanako = 1
        continue
    for i in range(min(len(card_taro), len(card_hanako))):
        if len(card_taro) > len(card_hanako):
            point_taro = 3
        if len(card_taro) < len(card_hanako):
            point_hanako = 3
        if ord(card_taro[i:i+1]) > ord(card_hanako[i:i+1]):
            point_taro = 3
            point_hanako = 0
            break
        if ord(card_taro[i:i+1]) < ord(card_hanako[i:i+1]):
            point_taro = 0
            point_hanako = 3
            break

    score_taro += point_taro
    score_hanako += point_hanako

print("{0} {1}".format(score_taro, score_hanako))

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

#include <iostream>
#include <string>

static const int drawPoint = 1;
static const int winPoint = 3;

static const enum Result
{
	WINNER_A,
	DRAW,
	WINNER_B,
};

Result game(const std::string a, const std::string b);

int main(void)
{
	int n;
	std::cin >> n;
	int point_a = 0;
	int point_b = 0;
	std::string a, b;
	for (int i = 0; i < n; i++)
	{
		std::cin >> a >> b;
		switch (game(a, b))
		{
		case WINNER_A:
			point_a += winPoint;
			break;
		case DRAW:
			point_a += drawPoint;
			point_b += drawPoint;
			break;
		case WINNER_B:
			point_b += winPoint;
			break;
		default:
			break;
		}
	}
	printf("%d %d", point_a, point_b);
	return 0;
}

Result game(const std::string a,const std::string b)
{
	
	if (a[0] > b[0])
	{
		return WINNER_A;
	}
	else if (a[0] < b[0])
	{
		return WINNER_B;
	}
	else
	{
		std::string a_sub, b_sub;
		a_sub = a.substr(1);
		b_sub = a.substr(1);
		if (a_sub.size() > 0 && b_sub.size() == 0)
		{
			return WINNER_A;
		}
		else if (a_sub.size() == 0 && b_sub.size() > 0)
		{
			return WINNER_B;
		}
		else if (a_sub.size() == 0 && b_sub.size() == 0)
		{
			return DRAW;
		}
		else
		{
			return game(a_sub, b_sub);
		}
	}
}

Compiler output:
a.cc:7:1: error: a storage class can only be specified for objects and functions
    7 | static const enum Result
      | ^~~~~~
Language: C++

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

static const int drawPoint = 1;
static const int winPoint = 3;

static const enum Result
{
	WINNER_A,
	DRAW,
	WINNER_B,
};

Result game(const std::string a, const std::string b);

int main(void)
{
	int n;
	std::cin >> n;
	int point_a = 0;
	int point_b = 0;
	std::string a, b;
	for (int i = 0; i < n; i++)
	{
		std::cin >> a >> b;
		switch (game(a, b))
		{
		case WINNER_A:
			point_a += winPoint;
			break;
		case DRAW:
			point_a += drawPoint;
			point_b += drawPoint;
			break;
		case WINNER_B:
			point_b += winPoint;
			break;
		default:
			break;
		}
	}
	printf("%d %d", point_a, point_b);
	return 0;
}

Result game(const std::string a,const std::string b)
{
	
	if (a[0] > b[0])
	{
		return WINNER_A;
	}
	else if (a[0] < b[0])
	{
		return WINNER_B;
	}
	else
	{
		std::string a_sub, b_sub;
		a_sub = a.substr(1);
		b_sub = a.substr(1);
		if (a_sub.size() > 0 && b_sub.size() == 0)
		{
			return WINNER_A;
		}
		else if (a_sub.size() == 0 && b_sub.size() > 0)
		{
			return WINNER_B;
		}
		else if (a_sub.size() == 0 && b_sub.size() == 0)
		{
			return DRAW;
		}
		else
		{
			return game(a_sub, b_sub);
		}
	}
}

Compiler output:
a.cc:8:1: error: a storage class can only be specified for objects and functions
    8 | static const enum Result
      | ^~~~~~
Language: C++

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

static const int drawPoint = 1;
static const int winPoint = 3;

static enum Result
{
	WINNER_A,
	DRAW,
	WINNER_B,
};

Result game(const std::string a, const std::string b);

int main(void)
{
	int n;
	std::cin >> n;
	int point_a = 0;
	int point_b = 0;
	std::string a, b;
	for (int i = 0; i < n; i++)
	{
		std::cin >> a >> b;
		switch (game(a, b))
		{
		case WINNER_A:
			point_a += winPoint;
			break;
		case DRAW:
			point_a += drawPoint;
			point_b += drawPoint;
			break;
		case WINNER_B:
			point_b += winPoint;
			break;
		default:
			break;
		}
	}
	printf("%d %d", point_a, point_b);
	return 0;
}

Result game(const std::string a,const std::string b)
{
	
	if (a[0] > b[0])
	{
		return WINNER_A;
	}
	else if (a[0] < b[0])
	{
		return WINNER_B;
	}
	else
	{
		std::string a_sub, b_sub;
		a_sub = a.substr(1);
		b_sub = a.substr(1);
		if (a_sub.size() > 0 && b_sub.size() == 0)
		{
			return WINNER_A;
		}
		else if (a_sub.size() == 0 && b_sub.size() > 0)
		{
			return WINNER_B;
		}
		else if (a_sub.size() == 0 && b_sub.size() == 0)
		{
			return DRAW;
		}
		else
		{
			return game(a_sub, b_sub);
		}
	}
}

Compiler output:
a.cc:8:1: error: a storage class can only be specified for objects and functions
    8 | static enum Result
      | ^~~~~~
Language: C++

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

int main(){
	int a,b=0,c=0;
	string d,e;
	cin >>a;
	for(int i=0;i<a;i++){
		cin>>d>>e;
		if(d.compare(e)>0)b=b+3;
		else if(d.compare(e)==0)b++;c++;
		else if(d.compare(e)<0)c=c+3;
	}
	cout <<b<<" "<<c<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'else' without a previous 'if'
   12 |                 else if(d.compare(e)<0)c=c+3;
      |                 ^~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num,L1,R1,answer;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l >> r;

	if (l == r){
		L1++;
		R1++;
	}
	for (int j = 0 ; j < 100 ; j++ ){



		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R

		if (answer < 0){
			R1 += 3;
			break;
		}else if (answer > 0){
			L1 += 3;
			break;
		}



	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'L' was not declared in this scope
   24 |                 L += l[j + 1] - 'a';
      |                 ^
a.cc:25:17: error: 'R' was not declared in this scope
   25 |                 R += r[j + 1] - 'a';
      |                 ^
a.cc:31:18: error: 'else' without a previous 'if'
   31 |                 }else if (answer > 0){
      |                  ^~~~
a.cc:40:2: error: expected '}' at end of input
   40 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num,L1,R1,answer;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l >> r;

	if (l == r){
		L1++;
		R1++;
	}
	for (int j = 0 ; j < 100 ; j++ ){



		L = l[j + 1] - 'a';
		R = r[j + 1] - 'a';
		answer = L - R

		if (answer < 0){
			R1 += 3;
			break;
		}else if (answer > 0){
			L1 += 3;
			break;
		}



	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'L' was not declared in this scope
   24 |                 L = l[j + 1] - 'a';
      |                 ^
a.cc:25:17: error: 'R' was not declared in this scope
   25 |                 R = r[j + 1] - 'a';
      |                 ^
a.cc:31:18: error: 'else' without a previous 'if'
   31 |                 }else if (answer > 0){
      |                  ^~~~
a.cc:40:2: error: expected '}' at end of input
   40 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num,L1,R1,answer;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l >> r;

	if (l == r){
		L1++;
		R1++;
	}
	for (int j = 0 ; j < 100 ; j++ ){



		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R

		if (answer < 0){
			R1 += 3;
			break;
		}
	    if (answer > 0){
			L1 += 3;
			break;
		}



	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'L' was not declared in this scope
   24 |                 L += l[j + 1] - 'a';
      |                 ^
a.cc:25:17: error: 'R' was not declared in this scope
   25 |                 R += r[j + 1] - 'a';
      |                 ^
a.cc:41:2: error: expected '}' at end of input
   41 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer,L = 0,R = 0;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l >> r;

	if (l == r){
		L1++;
		R1++;
	}
	for (int j = 0 ; j < 100 ; j++ ){



		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}



	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'L1' was not declared in this scope; did you mean 'L'?
   17 |                 L1++;
      |                 ^~
      |                 L
a.cc:18:17: error: 'R1' was not declared in this scope; did you mean 'R'?
   18 |                 R1++;
      |                 ^~
      |                 R
a.cc:26:31: error: expected ';' before 'if'
   26 |                 answer = L - R
      |                               ^
      |                               ;
   27 | 
   28 |                 if (answer < 0){
      |                 ~~             
a.cc:41:2: error: expected '}' at end of input
   41 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer,L = 0,R = 0;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l >> r;

	if (l == r){
		L1++;
		R1++;
	}
	for (int j = 0 ; j < 100 ; j++ ){



		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}



	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'L1' was not declared in this scope; did you mean 'L'?
   17 |                 L1++;
      |                 ^~
      |                 L
a.cc:18:17: error: 'R1' was not declared in this scope; did you mean 'R'?
   18 |                 R1++;
      |                 ^~
      |                 R
a.cc:41:2: error: expected '}' at end of input
   41 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer,L = 0,R = 0;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	if (l == r){
		L1++;
		R1++;
	}
	for (int j = 0 ; j < 100 ; j++ ){



		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}



	}
	cout << xL << "" << xR << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'L1' was not declared in this scope; did you mean 'L'?
   18 |                 L1++;
      |                 ^~
      |                 L
a.cc:19:17: error: 'R1' was not declared in this scope; did you mean 'R'?
   19 |                 R1++;
      |                 ^~
      |                 R
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer,L = 0,R = 0;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	if (l == r){
		L1++;
		R1++;
	}
	for (int j = 0 ; j < 100 ; j++ ){



		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}



	}
	cout << xL << "" << xR;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'L1' was not declared in this scope; did you mean 'L'?
   18 |                 L1++;
      |                 ^~
      |                 L
a.cc:19:17: error: 'R1' was not declared in this scope; did you mean 'R'?
   19 |                 R1++;
      |                 ^~
      |                 R
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer,L = 0,R = 0;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	if (l == r){
		L1++;
		R1++;
	}
	for (int j = 0 ; j < 100 ; j++ ){



		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}



	}
	cout << xL << " " << xR << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'L1' was not declared in this scope; did you mean 'L'?
   18 |                 L1++;
      |                 ^~
      |                 L
a.cc:19:17: error: 'R1' was not declared in this scope; did you mean 'R'?
   19 |                 R1++;
      |                 ^~
      |                 R
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer,L = 0,R = 0;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	if (l == r){
		L1++;
		R1++;
	}
	for (int j = 0 ; j < 100 ; j++ ){



		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}



	}
	cout << xL << " " << xR;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'L1' was not declared in this scope; did you mean 'L'?
   18 |                 L1++;
      |                 ^~
      |                 L
a.cc:19:17: error: 'R1' was not declared in this scope; did you mean 'R'?
   19 |                 R1++;
      |                 ^~
      |                 R
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer,L = 0,R = 0;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	
	for (int j = 0 ; j < 100 ; j++ ){
		if (l == r){
		xL++;
		xR++;
	}



		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}



	}
	cout << xL << " " << xR << endl;
	return 0;
}

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

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer,L = 0,R = 0;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	
	for (int j = 0 ; j < 100 ; j++ ){
		if (l == r){
		xL++;
		xR++;
	}



		L += l[j] - 'a';
		R += r[j] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}



	}
	cout << xL << " " << xR << endl;
	return 0;
}

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

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer,L = 0,R = 0;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	
	for (int j = 1 ; j < 101 ; j++ ){
		if (l == r){
		xL++;
		xR++;
		}



		L += l[j] - 'a';
		R += r[j] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}

	}
	cout << xL << " " << xR << endl;
	return 0;
}

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

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer,L = 0,R = 0;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	
	for (int j = 1 ; j < 100 ; j++ ){
		if (l == r){
		xL++;
		xR++;
		}



		L += l[j] - 'a';
		R += r[j] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}

	}
	cout << xL << " " << xR << endl;
	return 0;
}

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

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer,;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	
	for (int j = 1 ; j < 101 ; j++ ){
		L = 0;
		R = 0;
		if (l == r){

		xL++;
		xR++;
		}



		L += l[j] - 'a';
		R += r[j] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}

	}
	cout << xL << " " << xR << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:34: error: expected unqualified-id before ';' token
    8 | int num = 0,xL = 0,xR = 0,answer,;
      |                                  ^
a.cc:19:17: error: 'L' was not declared in this scope
   19 |                 L = 0;
      |                 ^
a.cc:20:17: error: 'R' was not declared in this scope
   20 |                 R = 0;
      |                 ^
a.cc:45:2: error: expected '}' at end of input
   45 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer,;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	
	for (int j = 1 ; j < 102 ; j++ ){
		L = 0;
		R = 0;
		if (l == r){

		xL++;
		xR++;
		}



		L += l[j] - 'a';
		R += r[j] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}

	}
	cout << xL << " " << xR << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:34: error: expected unqualified-id before ';' token
    8 | int num = 0,xL = 0,xR = 0,answer,;
      |                                  ^
a.cc:19:17: error: 'L' was not declared in this scope
   19 |                 L = 0;
      |                 ^
a.cc:20:17: error: 'R' was not declared in this scope
   20 |                 R = 0;
      |                 ^
a.cc:45:2: error: expected '}' at end of input
   45 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer,;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	
	for (int j = 1 ; j < 102 ; j++ ){
		L = 0;
		R = 0;
		if (l == r){

		xL++;
		xR++;
		break;
		}



		L += l[j] - 'a';
		R += r[j] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}

	}
	cout << xL << " " << xR << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:34: error: expected unqualified-id before ';' token
    8 | int num = 0,xL = 0,xR = 0,answer,;
      |                                  ^
a.cc:19:17: error: 'L' was not declared in this scope
   19 |                 L = 0;
      |                 ^
a.cc:20:17: error: 'R' was not declared in this scope
   20 |                 R = 0;
      |                 ^
a.cc:46:2: error: expected '}' at end of input
   46 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	
	for (int j = 0  ; j < 100 ; j++ ){
		L = 0;
		R = 0;
		if (l == r){
		xL++;
		xR++;
		break;
		}



		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}

	}
	cout << xL << " " << xR << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'L' was not declared in this scope
   19 |                 L = 0;
      |                 ^
a.cc:20:17: error: 'R' was not declared in this scope
   20 |                 R = 0;
      |                 ^
a.cc:45:2: error: expected '}' at end of input
   45 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	
	for (int j = 0  ; j < 100 ; j++ ){
		L = 0;
		R = 0;
		if (l == r){
		xL++;
		xR++;
		break;
		}



		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}

	}
	cout << xL << " " << xR;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'L' was not declared in this scope
   19 |                 L = 0;
      |                 ^
a.cc:20:17: error: 'R' was not declared in this scope
   20 |                 R = 0;
      |                 ^
a.cc:45:2: error: expected '}' at end of input
   45 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	
	for (int j = 0  ; j < 100 ; j++ ){
		L = 0;
		R = 0;
		if (l == r){
		xL++;
		xR++;
		break;
		}



		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}

	}
}
	cout << xL << " " << xR;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'L' was not declared in this scope
   19 |                 L = 0;
      |                 ^
a.cc:20:17: error: 'R' was not declared in this scope
   20 |                 R = 0;
      |                 ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	
	for (int j = 0  ; j < 100 ; j++ ){
		L = 0;
		R = 0;
		if (l == r){
		xL++;
		xR++;
		break;
		}



		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}

	}
}
	cout << xL << " " << xR << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'L' was not declared in this scope
   19 |                 L = 0;
      |                 ^
a.cc:20:17: error: 'R' was not declared in this scope
   20 |                 R = 0;
      |                 ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	
	for (int j = 0  ; j < 100 ; j++ ){
		
		if (l == r){
		xL++;
		xR++;
		break;
		}

		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}

	}
}
	cout << xL << " " << xR << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'L' was not declared in this scope
   26 |                 L += l[j + 1] - 'a';
      |                 ^
a.cc:27:17: error: 'R' was not declared in this scope
   27 |                 R += r[j + 1] - 'a';
      |                 ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	
	for (int j = 0  ; j < 100 ; j++ ){
		
		if (l == r){
		xL++;
		xR++;
		break;
		}

		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}

	}
}
	cout << xL << " " << xR;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'L' was not declared in this scope
   26 |                 L += l[j + 1] - 'a';
      |                 ^
a.cc:27:17: error: 'R' was not declared in this scope
   27 |                 R += r[j + 1] - 'a';
      |                 ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	
	for (int j = 0  ; j < 100 ; j++ ){
		
		if (l == r){
		xL++;
		xR++;
		break;
		}

		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}

	}
}
	cout << xL << xR;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'L' was not declared in this scope
   26 |                 L += l[j + 1] - 'a';
      |                 ^
a.cc:27:17: error: 'R' was not declared in this scope
   27 |                 R += r[j + 1] - 'a';
      |                 ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
int num = 0,xL = 0,xR = 0,answer;
string l,r;

cin >> num;

for (int i = 0 ; i < num ; i++ ){
	cin >> l;
	cin >> r;

	
	for (int j = 0  ; j < 100 ; j++ ){
		L = 0;
		R = 0;
		if (l == r){
		xL++;
		xR++;
		break;
		}

		L += l[j + 1] - 'a';
		R += r[j + 1] - 'a';
		answer = L - R;

		if (answer < 0){
			xR += 3;
			break;
		}
	    if (answer > 0){
			xL += 3;
			break;
		}

	}
}
	cout << xL << " " << xR << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'L' was not declared in this scope
   19 |                 L = 0;
      |                 ^
a.cc:20:17: error: 'R' was not declared in this scope
   20 |                 R = 0;
      |                 ^
Language: C++

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

int main(){
int h=0,t=0,n;
string hs,ts;
cin >>n;
for(i=0;i<n;i++){
cin >>hs >>ts;
}
if(ts==hs) h++; t++;
else if(ts>hs) t=t+3;
else h=h+3;
cout <<h <<t <<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'i' was not declared in this scope
   10 | for(i=0;i<n;i++){
      |     ^
a.cc:14:1: error: 'else' without a previous 'if'
   14 | else if(ts>hs) t=t+3;
      | ^~~~
Language: C++

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

int main(){
int h=0,t=0,n;
string hs,ts;
cin >>n;
for(int i=0;i<n;i++){
cin >>hs >>ts;
if(ts==hs) h++; t++;
else if(ts>hs) t=t+3;
else h=h+3;
}
cout <<h <<t <<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:1: error: 'else' without a previous 'if'
   13 | else if(ts>hs) t=t+3;
      | ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
  int n, taro=0, hanako=0;
  stringj t, h;

  cin>>n;
  for(int i=0;i<n;i++){
    cin>>t>>h;
    if(t>h) taro+=3;
    else if(t<h) hanako+=3;
    else{
      taro++;
      hanako++;
    }
  }

  cout<<taro<<" "<<hanako<<endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'stringj' was not declared in this scope; did you mean 'stdin'?
    6 |   stringj t, h;
      |   ^~~~~~~
      |   stdin
a.cc:10:10: error: 't' was not declared in this scope
   10 |     cin>>t>>h;
      |          ^
a.cc:10:13: error: 'h' was not declared in this scope
   10 |     cin>>t>>h;
      |             ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(void){

  int number;
  int A = B = 0;
  cin >> number;

  for(int i=0; i<number; i++){
     string str1,str2;
     cin >> str1 >> str2;

     if(str1 > str2) A+= 3;
     else if(str1 == str2)
          A++;
          B++;
     else
         B+=3;
  }

  cout << A << " " << B << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: 'B' was not declared in this scope
    9 |   int A = B = 0;
      |           ^
a.cc:20:6: error: 'else' without a previous 'if'
   20 |      else
      |      ^~~~
Language: C++

#include <iostream>
#include <string>

int main() {
  int n;
  std::cin >> n;

  int scoreT = 0;
  int scoreH = 0;
  std::string cardT;
  std::string cardH;
  for(int i = 0; i < n; ++i) {
    std::cin >> cardT >> cardH;
    if(cardT > cardH) {
      scoreT += 3;
    else if(cardT < cardH) {
      scoreH += 3;
    else if(cardT == cardH) {
      scoreH += 1;
      scoreT += 1;
    }
  }
  std::cout << scoreT << " " << scoreH << std::endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: expected '}' before 'else'
   16 |     else if(cardT < cardH) {
      |     ^~~~
a.cc:14:23: note: to match this '{'
   14 |     if(cardT > cardH) {
      |                       ^
a.cc:18:5: error: expected '}' before 'else'
   18 |     else if(cardT == cardH) {
      |     ^~~~
a.cc:16:28: note: to match this '{'
   16 |     else if(cardT < cardH) {
      |                            ^
Language: C++

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

int _tmain(int argc, _TCHAR* argv[])
{
	int n;
	string s1,s2;
	int p1=0,p2=0;
	cin>>n;
	for(int i=0;i<n;i++){
	cin>>s1>>s2;
	if(s1==s2){
		p1++;
		p2++;
	}
	else if(s1<s2)p1+=3;
	else if(s1>s2)p2+=3;
	}
	cout<<p2<<" "<<p1<<endl;
	return 0;
}

Compiler output:
a.cc:5:22: error: '_TCHAR' has not been declared
    5 | int _tmain(int argc, _TCHAR* argv[])
      |                      ^~~~~~
Language: C++

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

int main(int argc, char *argv[])
{
    string taro, hanako;
    int count, taro_point = 0, hanako_point = 0;
    cin >> count;
    while (count--)
    {
        cin >> taro >> hanako;
        if (taro < hanako)
            taro_point += 3;
        else if (taro > hanako)
            hanako_point += 3;
        else (taro == hanako)
        {
            taro_point++;
            hanako_point++;
        }
    }
    cout << taro_point << " " << hanako_point << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:17:30: error: expected ';' before '{' token
   17 |         else (taro == hanako)
      |                              ^
      |                              ;
   18 |         {
      |         ~                     
a.cc:17:20: warning: ignoring return value of 'bool std::operator==(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&) [with _CharT = char; _Traits = char_traits<char>; _Alloc = allocator<char>]', declared with attribute 'nodiscard' [-Wunused-result]
   17 |         else (taro == hanako)
      |              ~~~~~~^~~~~~~~~~
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:3755:5: note: declared here
 3755 |     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
Language: C++

t=0
h=0
n=input()
for _ in range (n):
	s = raw_input().split()
	if s[0] > s[1]:
		t+=3
	elif s[0] < s[1]:
		h+=3
	else:
		t+=1
		h+=1
print str(t) + " " + str(h)


Compiler output:
a.cc:1:1: error: 't' does not name a type
    1 | t=0
      | ^