criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.Scanner;
public class Maic{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int scoa1=0,scoa2=0;
        String data[] = new String[2];

        int n=sc.nextInt();
        for(int i=0;i<n;i++){
        	data[0] = sc.next();
        	data[1] = sc.next();
        	if(data[0].compareTo(data[1])<=-1){
        		scoa1+=3;
        	}
        	else if(data[0].compareTo(data[1])>=1){
        		scoa2+=3;
        	}
        	else if(data[0].compareTo(data[1])==0){
        		scoa1++;scoa2++;
        	}
        	else{
        		System.out.println("EEE");
        	}
        }
        System.out.println(scoa2+" "+scoa1);
        sc.close();
    }
}


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

package String;

import java.util.ArrayList;
import java.util.Scanner;

public class Card_Game {

	public static void main(String[] args) {

		//
		int matches = 0;
		// 対戦者達
		String[] players = { "太郎", "花子" };
		// 対戦者達のインスタンスを入れるリスト
		ArrayList<player> players_beans = new ArrayList<player>();

		// 標準入力
		Scanner sc = new Scanner(System.in);

		// 対戦回数
		while (sc.hasNext()) {

			matches = sc.nextInt();
			break;
		}

		// 対戦回数分まわす
		for (int m = 0; m < matches; m++) {

			while (sc.hasNext()) {
				// 対戦者達のインスタンスを作る
				for (String val : players) {
					player obj = new player();
					obj.setName(val);
					obj.setCard(sc.next());
					players_beans.add(obj);
				}
			}
		}
	}
}

// 各プレイヤーのプロパティ
class player {

	//
	private String name = "";
	private String card = "";
	private int points = 0;

	// セッター
	public void setName(String n) {
		name = n;
	}

	public void setCard(String c) {
		card = c;
	}

	// 合計値を持つようにする
	public void setPoints(int p) {
		points += p;
	}

	// ゲッター
	public String getName() {
		return name;
	}

	public String getCard() {
		return card;
	}

	public int getPoints() {
		return points;
	}

}

Compiler output:
Main.java:6: error: class Card_Game is public, should be declared in a file named Card_Game.java
public class Card_Game {
       ^
1 error
Language: Java

package String;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Card_Game {

	public static void main(String[] args) {

		//
		int matches = 0;
		int taro_points = 0;
		int hanako_points = 0;
		// 対戦者達
		String[] players = { "太郎", "花子" };
		// 標準入力
		Scanner sc = new Scanner(System.in);
		//
		ArrayList<player> players_beans = null;

		// 対戦回数
		while (sc.hasNext()) {

			matches = sc.nextInt();
			break;
		}

		// 対戦回数分まわす
		for (int m = 0; m < matches; m++) {

			// カードを入れるリスト
			ArrayList<String> battle = new ArrayList<String>();
			// 対戦者達のインスタンスを入れるリスト
			players_beans = new ArrayList<player>();

			while (sc.hasNext()) {
				// 対戦者達のインスタンスを作る
				for (String val : players) {
					player obj = new player();
					obj.setName(val);
					obj.setCard(sc.next());
					players_beans.add(obj);
					// アルファベット順にソートするためにリストに入れる
					battle.add(obj.getCard());
				}

				// アルファベット順にソート
				Collections.sort(battle);

				// 引き分けの場合
				if (players_beans.get(0).getCard()
						.equals(players_beans.get(1).getCard())) {
					players_beans.get(0).setPoints(1);
					players_beans.get(1).setPoints(1);
				}

				// 太郎が勝つ場合
				else if (battle.get(0).equals(players_beans.get(1).getCard())) {
					players_beans.get(0).setPoints(3);
				}

				// 花子が勝つ場合
				else if (battle.get(0).equals(players_beans.get(0).getCard())) {
					players_beans.get(1).setPoints(3);
				}

				taro_points = taro_points + players_beans.get(0).getPoints();
				hanako_points = hanako_points
						+ players_beans.get(1).getPoints();

				break;
			}
		}

		// 出力
		System.out.println(taro_points + " " + hanako_points);
	}
}

// 各プレイヤーのプロパティ
class player {

	//
	private String name = "";
	private String card = "";
	private int points = 0;

	// セッター
	public void setName(String n) {
		name = n;
	}

	public void setCard(String c) {
		card = c;
	}

	// 合計値を持つようにする
	public void setPoints(int p) {
		points += p;
	}

	// ゲッター
	public String getName() {
		return name;
	}

	public String getCard() {
		return card;
	}

	public int getPoints() {
		return points;
	}

}

Compiler output:
Main.java:7: error: class Card_Game is public, should be declared in a file named Card_Game.java
public class Card_Game {
       ^
1 error
Language: Java

package String;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Card_Game2 {

	public static void main(String[] args) {

		//
		int matches = 0;
		// 対戦者達
		String[] players = { "太郎", "花子" };
		//
		ArrayList<player2> players_beans = new ArrayList<player2>();;
		//プレイヤーのインスタンスを作る
		for (String val : players) {
			player2 obj = new player2();
			obj.setName(val);
			players_beans.add(obj);
		}

		// 標準入力
		Scanner sc = new Scanner(System.in);


		// 対戦回数
		while (sc.hasNext()) {

			matches = sc.nextInt();
			break;
		}

		// 対戦回数分まわす
		for (int m = 0; m < matches; m++) {

			// カードを入れるリスト
			ArrayList<String> battle = new ArrayList<String>();

			while (sc.hasNext()) {
				// 入力文字列をリストに追加
				String taro_card = sc.next();
				String hanako_card = sc.next();
				
				battle.add(taro_card);
				battle.add(hanako_card);

				// アルファベット順にソート
				Collections.sort(battle);

				// 引き分けの場合
				if (taro_card.equals(hanako_card)) {
					players_beans.get(0).setPoints(1);
					players_beans.get(1).setPoints(1);
				}

				// 太郎が勝つ場合
				else if (battle.get(0).equals(hanako_card)) {
					players_beans.get(0).setPoints(3);
				}

				// 花子が勝つ場合
				else if (battle.get(0).equals(taro_card)) {
					players_beans.get(1).setPoints(3);
				}

				break;
			}
		}

		// 出力
		System.out.println(players_beans.get(0).getPoints() + " " + players_beans.get(1).getPoints());
	}
}

// 各プレイヤーのプロパティ
class player2 {

	//
	private String name = "";
	private String card = "";
	private int points = 0;

	// セッター
	public void setName(String n) {
		name = n;
	}

	public void setCard(String c) {
		card = c;
	}

	// 合計値を持つようにする
	public void setPoints(int p) {
		points += p;
	}

	// ゲッター
	public String getName() {
		return name;
	}

	public String getCard() {
		return card;
	}

	public int getPoints() {
		return points;
	}

}

Compiler output:
Main.java:7: error: class Card_Game2 is public, should be declared in a file named Card_Game2.java
public class Card_Game2 {
       ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int taro=0;
		int hanako=0;
		String first = "";
		String second = "";
		for(int i=0;i<n;i++){
			first = scan.next();
			second = scan.next();
			if((first.compareTo(second))>0)
				taro+=3;
			else if((first.compareTo(second))<0)
				hanako+=3;
			else{
				taro++;
				hanako++;
		}
		System.out.println(taro+" "+hanako);
	}
}

Compiler output:
Main.java:23: error: reached end of file while parsing
}
 ^
1 error
Language: C

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

int main()
{
 char s1[100], s2[100];
 int a;
 int sumt=0,sumh=0;
  scanf("%d",a)
  for(i=0;i<a;i++){
  scanf("%s %s", s1, s2);
  if ( strcmp(s1, s2) == 0 ) sumt++&&sumh++;
  else if ( strcmp(s1, s2) > 0 ) sumt+=3;
  else if ( strcmp(s1, s2) < 0 ) sumh+=3;
                  }
  printf("%d %d\n",sumt,sumh);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:16: error: expected ';' before 'for'
    9 |   scanf("%d",a)
      |                ^
      |                ;
   10 |   for(i=0;i<a;i++){
      |   ~~~
Language: C

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

int main()
{
 char s1[100], s2[100];
 int a;
 int sumt=0,sumh=0;
  scanf("%d",a);

  for(i=0;i<a;i++){
  scanf("%s %s", s1, s2);
  if ( strcmp(s1, s2) == 0 ) sumt++&&sumh++;
  else if ( strcmp(s1, s2) > 0 ) sumt+=3;
  else if ( strcmp(s1, s2) < 0 ) sumh+=3;
                  }

  printf("%d %d\n",sumt,sumh);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:7: error: 'i' undeclared (first use in this function)
   11 |   for(i=0;i<a;i++){
      |       ^
main.c:11:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int main(){
	int n;
	int tp = 0, hp = 0;
	char t[105],h[105];
	scanf("%d",&n);
	
	for(int i=0; i<n; i++){
		int = p;
		scanf("%s %s",t,h);
		p = strcmp( t,p)
		if(p == 0){
			tp++
			hp++
		}
		if else(p > 0){
			tp += 3;
		}
		else{
			hp += 3;
		}
	}
	printf("%d %d\n",tp,hp);
	
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:21: error: expected identifier or '(' before '=' token
   11 |                 int = p;
      |                     ^
main.c:13:17: error: 'p' undeclared (first use in this function)
   13 |                 p = strcmp( t,p)
      |                 ^
main.c:13:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:33: error: expected ';' before 'if'
   13 |                 p = strcmp( t,p)
      |                                 ^
      |                                 ;
   14 |                 if(p == 0){
      |                 ~~
Language: C

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

int main(){
	int n;
	int tp=0, hp=0;
	char t[105],h[105];
	scanf("%d",&n);
	
	for(int i=0; i<n; i++){
		int p;
		scanf("%s %s",t,h);
		p=strcmp( t,p)
		if(p==0){
			tp++
			hp++
		}
		if else(p>0){
			tp+=3;
		}
		else{
			hp+=3;
		}
	}
	printf("%d %d\n",tp,hp);
	
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:29: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   13 |                 p=strcmp( t,p)
      |                             ^
      |                             |
      |                             int
In file included from main.c:2:
/usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
main.c:13:31: error: expected ';' before 'if'
   13 |                 p=strcmp( t,p)
      |                               ^
      |                               ;
   14 |                 if(p==0){
      |                 ~~
Language: C

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

int main(){
	int n;
	int tp=0, hp=0;
	char t[105],h[105];
	scanf("%d",&n);
	
	for(int i=0; i<n; i++){
		int p;
		scanf("%s %s",t,h);
		p=strcmp( t,p)
		if(p==0){
			tp++;
			hp++;
		}
		if else(p>0){
			tp+=3;
		}
		else{
			hp+=3;
		}
	}
	printf("%d %d\n",tp,hp);
	
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:29: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   13 |                 p=strcmp( t,p)
      |                             ^
      |                             |
      |                             int
In file included from main.c:2:
/usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
main.c:13:31: error: expected ';' before 'if'
   13 |                 p=strcmp( t,p)
      |                               ^
      |                               ;
   14 |                 if(p==0){
      |                 ~~
Language: C

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

int main(){
	int n;
	int tp=0, hp=0;
	char t[105],h[105];
	scanf("%d",&n);
	
	for(int i=0; i<n; i++){
		int p;
		scanf("%s %s",t,h);
		p=strcmp( t,p);
		if(p==0){
			tp++;
			hp++;
		}
		if else(p>0){
			tp+=3;
		}
		else{
			hp+=3;
		}
	}
	printf("%d %d\n",tp,hp);
	
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:29: error: passing argument 2 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   13 |                 p=strcmp( t,p);
      |                             ^
      |                             |
      |                             int
In file included from main.c:2:
/usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                                      ~~~~~~~~~~~~^~~~
main.c:18:20: error: expected '(' before 'else'
   18 |                 if else(p>0){
      |                    ^~~~
      |                    (
Language: C

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

int main(void){
int i,j,n,m1,m2,ta=0,ha=0;
char taro[101],hanako[101];
scanf("%d",&n);
for(i=0;i<n;i++){
    scanf("%s%s",taro,hanako);
m1=strlen(taro);
m2=strlen(hanako);
if(m1>m2) m1=m2;

for(j=0;j<m1;j++){
   # printf("  %d %d\n",taro[j],hanako[j]);
if(taro[j]<hanako[j]){
    
ha+=3;
break;
}else if (taro[j]>hanako[j]){
ta+=3;
break;
}else{
    if(j=m1-1){
ta+=1;
ha+=1;
}

}
}

}
printf("%d %d\n",ta,ha);
return 0;

}


Compiler output:
main.c: In function 'main':
main.c:15:6: error: invalid preprocessing directive #printf
   15 |    # printf("  %d %d\n",taro[j],hanako[j]);
      |      ^~~~~~
Language: C

#include <iostream>
#include <string>
#include <cstdio>
#include <cmath>
 
using namespace std;
 
int main(void)
{   
    int num;
    cin >> num;
    int p1 = 0, p2 = 0;
 
    for (int i = 0; i < num; i++)
    {
        string w1, w2;
        cin >> w1;
        cin >> w2;
 
        if (w1 < w2)
            p2 += 3;
        else if (w2 < w1)
            p1 += 3;
        else if (w1 == w2)
        {
            p1++;
            p2++;
        }
    }
    cout << p1 << " " << p2 << endl;
 
 
}

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

#include <stdio.h>

int main(void)
{
	int n, point[2];
	char taro[101], hanako[101];
	int i, f;


	for(i=0;i<n;i++){
		scanf("%s %s", taro, hanako);

		f = strcmp(taro, hanako);
		if(f < 0)
			point[1]+=3;
		else if(f == 0){
			point[0]++;
			point[1]++;
		}
		else
			point[0]+=3;
	}

	printf("%d %d\n2, point[0], point[1]);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:21: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   13 |                 f = strcmp(taro, hanako);
      |                     ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strcmp'
    1 | #include <stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:24:16: warning: missing terminating " character
   24 |         printf("%d %d\n2, point[0], point[1]);
      |                ^
main.c:24:16: error: missing terminating " character
   24 |         printf("%d %d\n2, point[0], point[1]);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:26:9: error: expected expression before 'return'
   26 |         return 0;
      |         ^~~~~~
main.c:26:18: error: expected ';' before '}' token
   26 |         return 0;
      |                  ^
      |                  ;
   27 | }
      | ~
Language: C

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

int main(void){
  int trial,judge,tpoint=0,hpoint=0;
  char taro[110],hanako[110];

  scanf("%d",&trial);
  for(i=0;i<trial;i++){
    scanf("%s",taro);  scanf("%s",hanako);
    judge=strcmp(taro,hanako);
    if(judge>0)  tpoint+=3;
    else if(judge<0)  hpoint+=3;
    else {
      tpoint++;  hpoint++;
    }
  }
  printf("%d %d\n",tpoint,hpoint);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:7: error: 'i' undeclared (first use in this function)
    9 |   for(i=0;i<trial;i++){
      |       ^
main.c:9:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int main(){
    int n, i, j = 0, point1 = 0, point2 = 0;
    char str1[100], str2[100];
    
    scanf("%d", &n);
    for (i = 0; i < n; i++){
        scanf("%s %s", str1, str2);
        if (strcmp(str1, str2) == 0) {point1++; point2++;}
        else{
            while(1){
                if(str1[j] < str2[j]) {point2 += 3; break;}
                if(str1[j] > str2[j]) {point1 += 3; break;}
                j++;
                if (j = strlen(str1) || j = strlen(str2)){
                    if (strncmp(str1, str2, (strlen(str1) > strlen(str2)) ? strlen(str2) : strlen(str1)) == 0){
                        if (strlen(str1) > strlen(str2)) point1++;
                        else                             point2++;
                    }
                    break;
                }
            }
        }
    }
    printf("%d %d\n", point1, point2);
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:43: error: lvalue required as left operand of assignment
   17 |                 if (j = strlen(str1) || j = strlen(str2)){
      |                                           ^
Language: C

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

int main(){
    int n, i, j = 0, point1 = 0, point2 = 0;
    char str1[100], str2[100];
    
    scanf("%d", &n);
    for (i = 0; i < n; i++){
        scanf("%s %s", str1, str2);
        if (strcmp(str1, str2) == 0) {point1++; point2++;}
        else{
            while(1){
                if(str1[j] < str2[j]) {point2 += 3; break;}
                if(str1[j] > str2[j]) {point1 += 3; break;}
                if (j = strlen(str1) || j = strlen(str2)){
                    if (strncmp(str1, str2, (strlen(str1) > strlen(str2)) ? strlen(str2) : strlen(str1)) == 0){
                        if (strlen(str1) > strlen(str2)) point1++;
                        else                             point2++;
                    }
                    break;
                }
                j++;
            }
        }
    }
    printf("%d %d\n", point1, point2);
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:43: error: lvalue required as left operand of assignment
   16 |                 if (j = strlen(str1) || j = strlen(str2)){
      |                                           ^
Language: C

#include <stdio.h>
#include <string.h>
int main(void){
	char t[201],h[201];
	int n,taro=0,hanako=0;
	while(n--){
		scanf("%s %s",t,h);
		if(strcmp(t,h)>0);
			taro+=3;
		else if(strcmp(t,h)<0);
			hanako+=3;
		else{
			taro++;
			hanako++;
		}
	}
	printf("%d %d\n",taro,hanako);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:17: error: 'else' without a previous 'if'
   10 |                 else if(strcmp(t,h)<0);
      |                 ^~~~
main.c:12:17: error: 'else' without a previous 'if'
   12 |                 else{
      |                 ^~~~
Language: C

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

int main()
{
	char taro[200], hanako[200];
	int i, count, taro = 0, hanako = 0;
	
	scanf("%d", &count);
	
	for(i = 1; i <= count; i++)
	{
		scanf("%s%s", taro, hanako);
		
		if(strcmp(taro, hanako) == 0)
		{
		taro++; hanako++;
		}
		else if(strcmp(taro, hanako) == 1)
		{
		taro++;
		}
		else if(strcmp(taro, hanako) == -1)
		{
		hanako++;
		}
	}
	
	printf("%d %d\n", taro, hanako);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:23: error: conflicting types for 'taro'; have 'int'
    8 |         int i, count, taro = 0, hanako = 0;
      |                       ^~~~
main.c:7:14: note: previous declaration of 'taro' with type 'char[200]'
    7 |         char taro[200], hanako[200];
      |              ^~~~
main.c:8:33: error: conflicting types for 'hanako'; have 'int'
    8 |         int i, count, taro = 0, hanako = 0;
      |                                 ^~~~~~
main.c:7:25: note: previous declaration of 'hanako' with type 'char[200]'
    7 |         char taro[200], hanako[200];
      |                         ^~~~~~
Language: C

  int a,b,i;
  a = strlen(x);
  b = strlen(y);
  
  if ( a > b ){
    for ( i = 0 ; i < b ; i++ ){
      if ( x[i] > y[i] ) return TARO;
      if ( x[i] < y[i] ) return HANAKO;
    }
    return TARO;
  }
  
  if ( a < b ){
    for ( i = 0 ; i < a ; i++ ){
      if ( x[i] > y[i] ) return TARO;
      if ( x[i] < y[i] ) return HANAKO;
    }
    return HANAKO;
  }
  
  if ( a == b ){
    for ( i = 0 ; i < a ; i++ ){
      if ( x[i] > y[i] ) return TARO;
      if ( x[i] < y[i] ) return HANAKO;
    }
    return DROW;
  }

Compiler output:
main.c:2:3: warning: data definition has no type or storage class
    2 |   a = strlen(x);
      |   ^
main.c:2:3: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:2:7: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    2 |   a = strlen(x);
      |       ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strlen'
  +++ |+#include <string.h>
    1 |   int a,b,i;
main.c:2:7: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
    2 |   a = strlen(x);
      |       ^~~~~~
main.c:2:7: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:2:14: error: 'x' undeclared here (not in a function)
    2 |   a = strlen(x);
      |              ^
main.c:3:3: warning: data definition has no type or storage class
    3 |   b = strlen(y);
      |   ^
main.c:3:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
main.c:3:14: error: 'y' undeclared here (not in a function)
    3 |   b = strlen(y);
      |              ^
main.c:5:3: error: expected identifier or '(' before 'if'
    5 |   if ( a > b ){
      |   ^~
main.c:13:3: error: expected identifier or '(' before 'if'
   13 |   if ( a < b ){
      |   ^~
main.c:21:3: error: expected identifier or '(' before 'if'
   21 |   if ( a == b ){
      |   ^~
Language: C

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

int main (void){
int i,n,s;
char H[1000],T[1000];
int HS=0;
int TS=0;

scanf(???%d???,&n);
for(i=0;i<n;i++){
scanf(???%s %s???,&H,&T);
s=strcmp(H,T);
if(s>0){
HS+=3;
}else if(s<0){
TS+=3;
}else if(s=0){
HS+=1;
TS+=1;
}

}printf(???%d %d\n???,HS TS);


return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:7: error: expected expression before '?' token
   10 | scanf(???%d???,&n);
      |       ^
main.c:12:7: error: expected expression before '?' token
   12 | scanf(???%s %s???,&H,&T);
      |       ^
main.c:23:9: error: expected expression before '?' token
   23 | }printf(???%d %d\n???,HS TS);
      |         ^
main.c:23:17: error: stray '\' in program
   23 | }printf(???%d %d\n???,HS TS);
      |                 ^
Language: C

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

int main (void){
int i,n,s;
char H[1000],T[1000];
int HS=0;
int TS=0;

scanf(???%d???,&n);
for(i=0;i<n;i++){
scanf(???%s %s???,H,T);
s=strcmp(H,T);
if(s>0){
HS+=3;
}else if(s<0){
TS+=3;
}else if(s=0){
HS+=1;
TS+=1;
}

}printf(???%d %d\n???,HS TS);


return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:7: error: expected expression before '?' token
   10 | scanf(???%d???,&n);
      |       ^
main.c:12:7: error: expected expression before '?' token
   12 | scanf(???%s %s???,H,T);
      |       ^
main.c:23:9: error: expected expression before '?' token
   23 | }printf(???%d %d\n???,HS TS);
      |         ^
main.c:23:17: error: stray '\' in program
   23 | }printf(???%d %d\n???,HS TS);
      |                 ^
Language: C

#include<stdio.h>
#include<string.h>
int main() {
	int n, i, j=0, k=0;
	char a[100], b[100];
	scanf("%d", &n);
	for (i = 0;i < n;i++) {
		scanf("%s %s", a, b);
		int strcmp(a, b);
		if (strcmp(a, b) == 0) {
			j=j+1;
			k=k+1;
		}
		if (strcmp(a, b) > 0) {
			j = j + 3;
		}
		if (strcmp(a, b) < 0) {
			k = k + 3;
		}
	}
	printf("%d %d\n", j, k);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:17: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
    9 |                 int strcmp(a, b);
      |                 ^~~
Language: C

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

int main(void)
{
  int n;
  char taro[101];
  char hanako[101];
  int point_taro = 0;
  int point_hanako = 0;
  int i, j, k;

  scanf("%d", &n);

  for(i = 0; i < n; i++){
    scanf("%s %s", taro, hanako);

    if(strcmp(taro, hanako) > 0)
      point_taro += 3;
    else if(strcmp(taro, hanako) < 0)
      point_hanako += 3;
    else{
      point_taro++;
      point_hanako++;
    }

    printf("%d %d\n", taro, hanako);
    
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:30:1: error: expected declaration or statement at end of input
   30 | }
      | ^
Language: C

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

int main(void)
{
  int n;
  char taro[101];
  char hanako[101];
  int point_taro = 0;
  int point_hanako = 0;
  int i, j, k;

  scanf("%d", &n);

  for(i = 0; i < n; i++){
    scanf("%s %s", taro, hanako);

    if(strcmp(taro, hanako) > 0)
      point_taro += 3;
    else if(strcmp(taro, hanako) < 0)
      point_hanako += 3;
    else{
      point_taro++;
      point_hanako++;
    }

    printf("%d %d\n", point_taro, point_hanako);
    
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:30:1: error: expected declaration or statement at end of input
   30 | }
      | ^
Language: C

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


int main()
{
  int n,score1 = 0,score2 = 0;
  char n1[100],n2[100];

  scanf("%d",&n);

  for(i = 0; i < n; i++)
  {
    scanf("%s %s",n1,n2);
    if(strcmp(n1,n2) > 0) score1 += 3;
    else if(strcmp(n1,n2) == 0) 
    {
      score1++;
      score2++;
    }
    else if(strcmp < 0) score2 += 3;
  }
  printf("%d %d\n",score1,score2);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:7: error: 'i' undeclared (first use in this function)
   12 |   for(i = 0; i < n; i++)
      |       ^
main.c:12:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<iostream>
#include<stdio.h>
#include <string>
using namespace std;
/*int main() {
    int n, i, j, k,c,d,e,f;
    c = 0;
    d = 0;
    char a[1000], b[1000];
    cin >> n;
    for (i = 0; i < n; i++) {
        k = 0;
        e = 0;
        f = 0;
        for (j = 0; j < 1000; j++) {
            scanf_s("%c", &a[j]);
            if (a[j] == ' ')break;
            e++;
        }
        for (j = 0; j < 1000; j++) {
            scanf_s("%c", &b[j]);
            if (b[j] == '\n')break;
            f++;
        }
        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) {
                c += 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) {
                    d += 3;
                }
                else {
                    c++; 
                    d++;
                }
            }
        }
         
    }
    cout << d << " " << c << endl;
    return 0;
}
*/
/*int main() {
    string a, b, c;
    int n, i, j,s,t,p,q;
    p = 0; q = 0;
    cin >> n;
    for (i = 0; i < n; i++) {
        cin >> c;
        s = c.find(" ");
        a = c.substr(0, s);
        b = c.substr(s + 1);
        if (a > b) {
            p += 3;
        }
        if (a < b) {
            q += 3;
        }
        if (a == b) {
            p += 1;
            q += 1;
        }
    }
    cout << p << ' '<< q << endl;
    return 0;
}
*/
int main() {
    string a, b, c;
    int n, i, j, s, t, p, q;
    p = 0; q = 0;
    cin >> n;
    for (i = 0; i < n; i++) {
        cin >> a>>b;
        if (a > b) {
            p += 3;
        }
        if (a < b) {
            q += 3;
        }
        if (a == b) {
            p += 1;
            q += 1;
        }
    }
    cout << p << ' ' << q << endl;
    return 0;
}

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

main(n,x,y,t){
????????char a[101],b[101];
????????for(scanf("%d",&n);scanf("%s%s",a,b),t=strcmp(a,b),n--;){
????????????????x+=t>0?3:t==0?1:0;
????????????????y+=t<0?3:t==0?1:0;
????????}
????????printf("%d %d\n",x,y);
}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(n,x,y,t){
      | ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'y' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 't' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: expected expression before '?' token
    2 | ????????char a[101],b[101];
      | ^
main.c:3:1: error: expected expression before '?' token
    3 | ????????for(scanf("%d",&n);scanf("%s%s",a,b),t=strcmp(a,b),n--;){
      | ^
Language: C

n,x,y,t;
main(){
????????char a[101],b[101];
????????for(scanf("%d",&n);scanf("%s%s",a,b),t=strcmp(a,b),n--;){
????????????????x+=t>0?3:t==0?1:0;
????????????????y+=t<0?3:t==0?1:0;
????????}
????????printf("%d %d\n",x,y);
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n,x,y,t;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
    1 | n,x,y,t;
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 'y' [-Wimplicit-int]
    1 | n,x,y,t;
      |     ^
main.c:1:7: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
    1 | n,x,y,t;
      |       ^
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:3:1: error: expected expression before '?' token
    3 | ????????char a[101],b[101];
      | ^
main.c:4:1: error: expected expression before '?' token
    4 | ????????for(scanf("%d",&n);scanf("%s%s",a,b),t=strcmp(a,b),n--;){
      | ^
Language: C

n,x,y,t;
main(){
????????char a[101],b[101];
????????for(scanf("%d",&n);scanf("%s%s",a,b),n--;){
????????    t=strcmp(a,b);
????????????????x+=t>0?3:t==0?1:0;
????????????????y+=t<0?3:t==0?1:0;
????????}
????????printf("%d %d\n",x,y);
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n,x,y,t;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
    1 | n,x,y,t;
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 'y' [-Wimplicit-int]
    1 | n,x,y,t;
      |     ^
main.c:1:7: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
    1 | n,x,y,t;
      |       ^
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:3:1: error: expected expression before '?' token
    3 | ????????char a[101],b[101];
      | ^
main.c:4:1: error: expected expression before '?' token
    4 | ????????for(scanf("%d",&n);scanf("%s%s",a,b),n--;){
      | ^
Language: C

n,x,y,t;
main(){
????????char a[101],b[101];
????????for(scanf("%d",&n);n--;){
????????????????scanf("%s%s",a,b);
????????????????t=strcmp(a,b);
????????????????x+=t>0?3:t==0?1:0;
????????????????y+=t<0?3:t==0?1:0;
????????}
????????printf("%d %d\n",x,y);
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n,x,y,t;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
    1 | n,x,y,t;
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 'y' [-Wimplicit-int]
    1 | n,x,y,t;
      |     ^
main.c:1:7: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
    1 | n,x,y,t;
      |       ^
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:3:1: error: expected expression before '?' token
    3 | ????????char a[101],b[101];
      | ^
main.c:4:1: error: expected expression before '?' token
    4 | ????????for(scanf("%d",&n);n--;){
      | ^
Language: C

#include <string.h>
n,x,y,t;
main(){
????????char a[101],b[101];
????????for(scanf("%d",&n);n--;){
????????????????scanf("%s%s",a,b);
????????????????t=strcmp(a,b);
????????????????x+=t>0?3:t==0?1:0;
????????????????y+=t<0?3:t==0?1:0;
????????}
????????printf("%d %d\n",x,y);
}

Compiler output:
main.c:2:1: warning: data definition has no type or storage class
    2 | n,x,y,t;
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:2:3: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
    2 | n,x,y,t;
      |   ^
main.c:2:5: error: type defaults to 'int' in declaration of 'y' [-Wimplicit-int]
    2 | n,x,y,t;
      |     ^
main.c:2:7: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
    2 | n,x,y,t;
      |       ^
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:1: error: expected expression before '?' token
    4 | ????????char a[101],b[101];
      | ^
main.c:5:1: error: expected expression before '?' token
    5 | ????????for(scanf("%d",&n);n--;){
      | ^
Language: C

#include <stdio.h>
#include <string.h>
n,x,y,t;
main(){
????????char a[101],b[101];
????????for(scanf("%d",&n);n--;){
????????????????scanf("%s%s",a,b);
????????????????t=strcmp(a,b);
????????????????x+=t>0?3:t==0?1:0;
????????????????y+=t<0?3:t==0?1:0;
????????}
????????printf("%d %d\n",x,y);
}

Compiler output:
main.c:3:1: warning: data definition has no type or storage class
    3 | n,x,y,t;
      | ^
main.c:3:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:3:3: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
    3 | n,x,y,t;
      |   ^
main.c:3:5: error: type defaults to 'int' in declaration of 'y' [-Wimplicit-int]
    3 | n,x,y,t;
      |     ^
main.c:3:7: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int]
    3 | n,x,y,t;
      |       ^
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:5:1: error: expected expression before '?' token
    5 | ????????char a[101],b[101];
      | ^
main.c:6:1: error: expected expression before '?' token
    6 | ????????for(scanf("%d",&n);n--;){
      | ^
Language: C

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

int main()
{
	int n, tp = 0, hp = 0, i = 0;
	string taro, hanako;

	cin >> n;
	for (i = 0; i < n; i++){
		cin >> taro >> hanako;
		if (taro > hanako) 
			tp += 3;
		else if (taro < hanako) 
			hp += 3;
		else if (taro == hanako) { 
			tp++; 
			hp++; 
		}			
	}

	printf("%d %d\n", tp, hp);	

	return(0);
}


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

#include<stdio.h>
#define COUNT_RESET 0
#define ARRAY_RESET 0
#define LOOP_RESET 	0
#define RETURN 		0

void 			array_reset( unsigned char *array, unsigned short size );
unsigned short 	scan_word( unsigned char *str, unsigned short length_max );

int main(){
	unsigned char	tarou_card[100 + 1];
	unsigned short	tarou_num;
	unsigned short	tarou_score = 0;
	unsigned char 	hanako_card[100 + 1];
	unsigned short	hanako_num;
	unsigned short	hanako_score = 0;
	unsigned short	game_times;
	unsigned char	win;
	unsigned short	i, j;
	
	/* 配列初期化 */
	array_reset( tarou_card, 100 + 1 );
	array_reset( hanako_card, 100 + 1 );
	
	/* ゲーム回数の入力 */
	scanf( "%d", &game_num );
	
	/* カードの入力、勝者判定 */
	for( i = 0;i < game_times;i++ ){
		/* 太郎のカードの入力 */
		tarou_num = scan_word( tarou_card, 100 + 1 );
		/* 花子のカードの入力 */
		hanako_num = scan_word( hanako_card, 100 + 1 );
		
		/* 勝者判定 */
		for( j = 0;j < 100 + 1;j++ ){
			/* 太郎と花子のカードの文字が同じ場合ループ先頭に戻る */
			if( tarou_card[j] == hanako_card[j] ){
				continue;
			}
			
			/* 勝ったのが太郎なら勝者フラグを１に、花子なら２に、引き分けなら０にする */
			if( ( j = tarou_num ) && ( j = hanako_num ) ){
				win = 0;
			}
			else if( tarou_card[j] > hanako_card[j] ){
				win = 1;
			}
			else if( tarou_card[j] < hanako_card[j] ){
				win = 2;
			}
			else;
			
			/* 判定が出た場合ループを抜ける */
			break;
		}
		/* 得点の加算 */
		switch( win  ){
		case 0:
			tarou_score++;
			hanako_score++;
		case 1:
			tarou_score += 3;
		case 2:
			hanako_score += 3;
		default;
		}
	}
	
	/* 結果の出力 */
	printf("%d %d\n", tarou_score, hanako_score);
	
	return 0;
}

/* 関数名：配列初期化 */
/* 概要：渡されたアドレスを先頭とする配列の値を初期化する */
/* 引数：初期化する配列の先頭アドレス、その配列の大きさ */
/* 戻り値：なし */
void array_reset( unsigned char *array, unsigned short size )
{
	unsigned short usW_C_i;	/* ループ変数 */
	
	/* 配列の初期化 */
	for( usW_C_i = COUNT_RESET; usW_C_i < size; usW_C_i++ ){
 		*( array + usW_C_i ) = ARRAY_RESET;
 	}
}

/* 関数名：文字列入力 */
/* 概要：文字列を入力する。入力された文字列の長さを返す */
/* 引数：文字列を格納する配列の先頭アドレス、その配列の大きさ */
/* 戻り値：入力された文字列の長さ */
unsigned short scan_word( unsigned char *str, unsigned short length_max )
{
	unsigned short usW_C_count_text = COUNT_RESET;	/* 文字列長カウンタ */
	unsigned short usW_C_i;                       	/* ループ変数 */

	/* 配列の初期化 */
	array_reset( str, length_max );
	
	/* 文字列の入力 */
	for( usW_C_i = LOOP_RESET; usW_C_i < length_max; usW_C_i++ ){
		scanf("%c", str + usW_C_i);
		/* 入力終了の処理 */
		if( (*(str + usW_C_i) == ' ') || (*(str + usW_C_i) == '\n') ){
			break;
		}
		/* 文字数をカウント */
		usW_C_count_text++;
	}

	/* 文字列長を返す */
	return usW_C_count_text;
}



Compiler output:
main.c: In function 'main':
main.c:26:23: error: 'game_num' undeclared (first use in this function); did you mean 'game_times'?
   26 |         scanf( "%d", &game_num );
      |                       ^~~~~~~~
      |                       game_times
main.c:26:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:66:24: error: expected ':' before ';' token
   66 |                 default;
      |                        ^
      |                        :
Language: C

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

int main(void) {
	int n, i, tp=0, hp=0;
	char t[1000], h[1000];
	scanf("%d", &n);
	for(i=0; i<n; i++){
		scanf("%s %s", &t[i], h[i])
		if(strcmp(t[i], h[i]) == 0){
			tp += 1;
			hp += 1;
		}
		if(strcmp(t[i], h[i]) < 0) hp += 3;
		else tp += 3;
	}
	printf("%d %d", tp, hp);
	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:9:44: error: expected ';' before 'if'
    9 |                 scanf("%s %s", &t[i], h[i])
      |                                            ^
      |                                            ;
   10 |                 if(strcmp(t[i], h[i]) == 0){
      |                 ~~                          
main.c:15:17: error: 'else' without a previous 'if'
   15 |                 else tp += 3;
      |                 ^~~~
Language: C

#include <stdio.h>int main(void){    int n,taro=0,hanako=0,i;    char t[100],h[100];    scanf("%d",&n);    for(i=0;i<n;i++){        scanf("%s %s",&t[i],&h[i]);        if(t[i]==h[i]){            taro++;            hanako++;        }        else if(t[i]<h[i]){            hanako+=3;        }        else{            taro+=3;        }    }    printf("%d %d\n",taro,hanako);    return 0;}


Compiler output:
main.c:1:19: warning: extra tokens at end of #include directive
    1 | #include <stdio.h>int main(void){    int n,taro=0,hanako=0,i;    char t[100],h[100];    scanf("%d",&n);    for(i=0;i<n;i++){        scanf("%s %s",&t[i],&h[i]);        if(t[i]==h[i]){            taro++;            hanako++;        }        else if(t[i]<h[i]){            hanako+=3;        }        else{            taro+=3;        }    }    printf("%d %d\n",taro,hanako);    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 <stdio.h>
#include <string.h>
#define MAX 100int main(){    
int n;    
int t_point=0, h_point=0;    
char tarou[MAX], hanako[MAX];    
scanf("%d", &n);    
for(;n>0;n--){        
scanf(" %s %s", tarou, hanako);       
if(strcmp(tarou, hanako)>0){            
t_point+=3;        }
else if(strcmp(tarou, hanako)==0){            
t_point+=1;            
h_point+=1;        }
else if(strcmp(tarou, hanako)<0){            
h_point+=3;        }    }    
printf("%d %d\n", t_point, h_point);    
return 0;
}


Compiler output:
main.c:3:13: error: invalid suffix "int" on integer constant
    3 | #define MAX 100int main(){
      |             ^~~~~~
main.c:6:12: note: in expansion of macro 'MAX'
    6 | char tarou[MAX], hanako[MAX];
      |            ^~~
main.c:3:20: error: expected ']' before 'main'
    3 | #define MAX 100int main(){
      |                    ^~~~
main.c:6:12: note: in expansion of macro 'MAX'
    6 | char tarou[MAX], hanako[MAX];
      |            ^~~
main.c:3:13: error: invalid suffix "int" on integer constant
    3 | #define MAX 100int main(){
      |             ^~~~~~
main.c:6:25: note: in expansion of macro 'MAX'
    6 | char tarou[MAX], hanako[MAX];
      |                         ^~~
Language: C

#include <stdio.h>
#include <string.h>
#define MAX 100int main(){    
int n;    
int t_point=0, h_point=0;    
char tarou[MAX], hanako[MAX];    
scanf("%d", &n);    
for(;n>0;n--){        
scanf(" %s %s", tarou, hanako);       
if(strcmp(tarou, hanako)>0){            
t_point+=3;        }
else if(strcmp(tarou, hanako)==0){            
t_point+=1;            
h_point+=1;        }
else if(strcmp(tarou, hanako)<0)
{            
h_point+=3;        
}    
}    
printf("%d %d\n", t_point, h_point);    
return 0;
}


Compiler output:
main.c:3:13: error: invalid suffix "int" on integer constant
    3 | #define MAX 100int main(){
      |             ^~~~~~
main.c:6:12: note: in expansion of macro 'MAX'
    6 | char tarou[MAX], hanako[MAX];
      |            ^~~
main.c:3:20: error: expected ']' before 'main'
    3 | #define MAX 100int main(){
      |                    ^~~~
main.c:6:12: note: in expansion of macro 'MAX'
    6 | char tarou[MAX], hanako[MAX];
      |            ^~~
main.c:3:13: error: invalid suffix "int" on integer constant
    3 | #define MAX 100int main(){
      |             ^~~~~~
main.c:6:25: note: in expansion of macro 'MAX'
    6 | char tarou[MAX], hanako[MAX];
      |                         ^~~
Language: C

#include <stdio.h>
#include <string.h>
#define MAX 100int main(){    
int n;    
int t_point=0, h_point=0;    
char tarou[MAX], hanako[MAX];    
scanf("%d", &n);    
for(;n>0;n--){        
scanf(" %s %s", tarou, hanako);        
if(strcmp(tarou, hanako)>0){            
t_point+=3;        
}
else if(strcmp(tarou, hanako)==0){            
t_point+=1;            h_point+=1;        
}
else if(strcmp(tarou, hanako)<0){            
h_point+=3;        
}    
}    
printf("%d %d\n", t_point, h_point);    
return 0;
}


Compiler output:
main.c:3:13: error: invalid suffix "int" on integer constant
    3 | #define MAX 100int main(){
      |             ^~~~~~
main.c:6:12: note: in expansion of macro 'MAX'
    6 | char tarou[MAX], hanako[MAX];
      |            ^~~
main.c:3:20: error: expected ']' before 'main'
    3 | #define MAX 100int main(){
      |                    ^~~~
main.c:6:12: note: in expansion of macro 'MAX'
    6 | char tarou[MAX], hanako[MAX];
      |            ^~~
main.c:3:13: error: invalid suffix "int" on integer constant
    3 | #define MAX 100int main(){
      |             ^~~~~~
main.c:6:25: note: in expansion of macro 'MAX'
    6 | char tarou[MAX], hanako[MAX];
      |                         ^~~
Language: C


#include <stdio.h>


char *gets(char *s);

int main()
{
	char buf[300], *t, *h, *p;
	int taro, hanako;
	int i, n, ret;

	gets(buf);
	n = atoi(buf);
	taro = hanako = 0;
	for (i = 0; i < n; i++) {
		gets(buf); p = buf;

		while (isspace(*p)) p++;
		t = p;
		while (isalpha(*p)) p++;
		*p++ = 0;

		while (isspace(*p)) p++;
		h = p;
		while (isalpha(*p)) p++;
		*p++ = 0;

		ret = strcmp(t, h);
		if (ret > 0) taro += 3;
		else if (ret < 0) hanako += 3;
		else taro++, hanako++;
	}
	printf("%d %d\n", taro, hanako);
	return 0;
}






  

 



Compiler output:
main.c: In function 'main':
main.c:14:13: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   14 |         n = atoi(buf);
      |             ^~~~
main.c:19:24: error: implicit declaration of function 'isspace' [-Wimplicit-function-declaration]
   19 |                 while (isspace(*p)) p++;
      |                        ^~~~~~~
main.c:3:1: note: include '<ctype.h>' or provide a declaration of 'isspace'
    2 | #include <stdio.h>
  +++ |+#include <ctype.h>
    3 | 
main.c:21:24: error: implicit declaration of function 'isalpha' [-Wimplicit-function-declaration]
   21 |                 while (isalpha(*p)) p++;
      |                        ^~~~~~~
main.c:21:24: note: include '<ctype.h>' or provide a declaration of 'isalpha'
main.c:29:23: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   29 |                 ret = strcmp(t, h);
      |                       ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strcmp'
    2 | #include <stdio.h>
  +++ |+#include <string.h>
    3 |
Language: C

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

int main(){
	
	char taro[1000],hanako[1000]
	int n,t_point,h_point;
    
	scanf("%d", &n);
	for(;n>0;n--){
		scanf(" %s %s", tarou, hanako);
		if(strcmp(tarou, hanako)>0){
			t_point+=3;
		}else if(strcmp(tarou, hanako)==0){
			t_point+=1;
			h_point+=1;
		}else if(strcmp(tarou, hanako)<0){
			h_point+=3;
		}
	}
    
    printf("%d %d\n",t_point,h_point);
    
    return 0;

}

Compiler output:
main.c: In function 'main':
main.c:7:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
    7 |         int n,t_point,h_point;
      |         ^~~
main.c:9:22: error: 'n' undeclared (first use in this function)
    9 |         scanf("%d", &n);
      |                      ^
main.c:9:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:33: error: 'tarou' undeclared (first use in this function); did you mean 'taro'?
   11 |                 scanf(" %s %s", tarou, hanako);
      |                                 ^~~~~
      |                                 taro
main.c:11:40: error: 'hanako' undeclared (first use in this function)
   11 |                 scanf(" %s %s", tarou, hanako);
      |                                        ^~~~~~
main.c:13:25: error: 't_point' undeclared (first use in this function)
   13 |                         t_point+=3;
      |                         ^~~~~~~
main.c:16:25: error: 'h_point' undeclared (first use in this function)
   16 |                         h_point+=1;
      |                         ^~~~~~~
Language: C

#include<stdio.h>

int main(int argc, char* argv[])
{
  int i, n, a, b, cmp;
  char s1[200], s2[100];

  scanf("%d", &n);
  a = b = 0;
  for(i = 0; i < n; i++){
    scanf("%s %s", s1, s2);
    cmp = strcmp(s1, s2);
    if(0 < smp){
      a += 3;
    }else if(smp < 0){
      b += 3;
    }else if(cmp == 0){
      a += 1;
      b += 1;
    }
  }
  printf("%d %d\n", a, b);
  return(0);
}

Compiler output:
main.c: In function 'main':
main.c:12:11: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   12 |     cmp = strcmp(s1, s2);
      |           ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strcmp'
    1 | #include<stdio.h>
  +++ |+#include <string.h>
    2 | 
main.c:13:12: error: 'smp' undeclared (first use in this function); did you mean 'cmp'?
   13 |     if(0 < smp){
      |            ^~~
      |            cmp
main.c:13:12: note: each undeclared identifier is reported only once for each function it appears in