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

#include<stdio.h>
#define COUNT_RESET 0
#define LOOP_RESET 0
int serch_word(char * str1, char * str2);
unsigned short s_scan_word(unsigned char * str, unsigned short length_max);

int main(){
	char str1[10], str2[1000];
	int long1, long2;
	int count = 0;
	int i;
	
	for(i = 0;i < 10;i++){
		str1[i] = 0;
	}
	for(i = 0;i < 1000;i++){
		str2[i] = 0;
	}
	
	long1 = s_scan_word(str1, 1000);
	
	while(1){
		long2 = s_scan_word(str2, 1000);
		if(serch_word("END_OF_TEXT\n", str2)){
			break;
		}
		if(long1 == long2){
			count += serch_word(str1, str2);
		}
		for(i = 0;i < long2;i++){
		str2[i] = 0;
		}
	}
	
	printf("%d\n", count);
	return 0;
}

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

	/* 文字列の入力 */
	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;
}

int serch_word(char * str1, char * str2)
{
	char * word = str1, sent = str2;
	int frg = 0;
	int i = 0;
	while(1){
		if(*(word + i) == '\n'){
			frg =1;
		}
		if(*(word + i) != *(sent + i)){
			break;
		}
		i++;
	}
	
	return frg;
}


Compiler output:
main.c: In function 'serch_word':
main.c:65:36: error: initialization of 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
   65 |         char * word = str1, sent = str2;
      |                                    ^~~~
main.c:72:35: error: invalid type argument of unary '*' (have 'int')
   72 |                 if(*(word + i) != *(sent + i)){
      |                                   ^~~~~~~~~~~
Language: C

#include<stdio.h>
#define COUNT_RESET 0
#define LOOP_RESET 0
int serch_word(char * str1, char * str2);
unsigned short s_scan_word(unsigned char * str, unsigned short length_max);

int main(){
	char str1[10], str2[1000];
	int long1, long2;
	int count = 0;
	int i;
	
	for(i = 0;i < 10;i++){
		str1[i] = 0;
	}
	for(i = 0;i < 1000;i++){
		str2[i] = 0;
	}
	
	long1 = s_scan_word(str1, 1000);
	
	while(1){
		long2 = s_scan_word(str2, 1000);
		if(serch_word("END_OF_TEXT\n", str2) == 1){
			break;
		}
		if(long1 == long2){
			count += serch_word(str1, str2);
		}
		for(i = 0;i < long2;i++){
		str2[i] = 0;
		}
	}
	
	printf("%d\n", count);
	return 0;
}

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

	/* 文字列の入力 */
	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;
}

int serch_word(char * str1, char * str2)
{
	char * word = str1, sent = str2;
	int frg = 0;
	int i = 0;
	while(1){
		if(*(word + i) == '\n'){
			frg =1;
		}
		if(*(word + i) != *(sent + i)){
			break;
		}
		i++;
	}
	
	return frg;
}


Compiler output:
main.c: In function 'serch_word':
main.c:65:36: error: initialization of 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
   65 |         char * word = str1, sent = str2;
      |                                    ^~~~
main.c:72:35: error: invalid type argument of unary '*' (have 'int')
   72 |                 if(*(word + i) != *(sent + i)){
      |                                   ^~~~~~~~~~~
Language: C

#include<stdio.h>
#define COUNT_RESET 0
#define LOOP_RESET 0
unsigned short serch_word(unsigned char * str1, unsigned char * str2);
unsigned short s_scan_word(unsigned char * str, unsigned short length_max);

int main(){
	unsigned char str1[10], str2[1000];
	unsigned short long1, long2;
	unsigned short count = 0;
	unsigned char end_sentence[] = {"END_OF_TEXT\n"};
	unsigned short i;
	
	for(i = 0;i < 10;i++){
		str1[i] = 0;
	}
	for(i = 0;i < 1000;i++){
		str2[i] = 0;
	}
	
	long1 = s_scan_word(str1, 1000);
	
	while(1){
		long2 = s_scan_word(str2, 1000);
		if(serch_word(end_sentence, str2) == 1){
			break;
		}
		
		for(i = 0;i < long1;i++){
			str1[i] |= 0x60;
		}
		for(i = 0;i < long2;i++){
			str2[i] |= 0x60;
		}
		if(long1 == long2){
			count += serch_word(str1, str2);
		}
		for(i = 0;i <= long2;i++){
			str2[i] = 0;
		}
	}
	
	printf("%d\n", count);
	return 0;
}

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

	/* 文字列の入力 */
	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;
}

int serch_word(unsigned char * str1, unsigned char * str2)
{
	unsigned char * word = str1, * sent = str2;
	unsigned int frg = 0;
	unsigned int i = 0;
	while(1){
		if(*(word + i) == '\n'){
			frg =1;
		}
		if(*(word + i) != *(sent + i)){
			break;
		}
		i++;
	}
	
	return frg;
}


Compiler output:
main.c:71:5: error: conflicting types for 'serch_word'; have 'int(unsigned char *, unsigned char *)'
   71 | int serch_word(unsigned char * str1, unsigned char * str2)
      |     ^~~~~~~~~~
main.c:4:16: note: previous declaration of 'serch_word' with type 'short unsigned int(unsigned char *, unsigned char *)'
    4 | unsigned short serch_word(unsigned char * str1, unsigned char * str2);
      |                ^~~~~~~~~~
Language: C

#include<stdio.h>
#define COUNT_RESET 0
#define LOOP_RESET 0
unsigned short serch_word(unsigned char * word, unsigned char * sent);
unsigned short s_scan_word(unsigned char * str, unsigned short length_max);

int main(){
	unsigned char word[10]
	unsigned char sent[1000];
	unsigned short word_length, sent_length;
	unsigned short count = 0;
	unsigned char sentence_end[] = {"END_OF_TEXT\n"};
	unsigned short i;
	
	for(i = 0;i < 10;i++){
		word[i] = 0;
	}
	for(i = 0;i < 1000;i++){
		sent[i] = 0;
	}
	
	word_length = s_scan_word(word, 1000);
	
	while(1){
		sent_length = s_scan_word(sent, 1000);
		if(serch_word(sentence_end, sent) == 1){
			break;
		}
		
		for(i = 0;i < word_length;i++){
			word[i] |= 0x60;
		}
		for(i = 0;i < sent_length;i++){
			sent[i] |= 0x60;
		}
		if(word_length == sent_length){
			count += serch_word(word, sent);
		}
		for(i = 0;i <= sent_length;i++){
			sent[i] = 0;
		}
	}
	
	printf("%d\n", count);
	return 0;
}

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

	/* 文字列の入力 */
	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;
}

unsigned short serch_word(unsigned char * word, unsigned char * sent)
{
	unsigned int frg = 0;
	unsigned int i = 0;
	while(1){
		if(*(word + i) == '\n'){
			frg =1;
		}
		if(*(word + i) != *(sent + i)){
			break;
		}
		i++;
	}
	
	return frg;
}


Compiler output:
main.c: In function 'main':
main.c:8:31: error: expected ';' before 'unsigned'
    8 |         unsigned char word[10]
      |                               ^
      |                               ;
    9 |         unsigned char sent[1000];
      |         ~~~~~~~~               
main.c:16:17: error: 'word' undeclared (first use in this function)
   16 |                 word[i] = 0;
      |                 ^~~~
main.c:16:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

void array_reset(unsigned char * array, unsigned short size);
unsigned short serch_word(unsigned char * word, unsigned char * sent);
unsigned short s_scan_word(unsigned char * str, unsigned short length_max);

int main(){
	unsigned char ubW_D_word[10];
	unsigned char ubW_D_sent[1000];
	unsigned short usW_D_word_length;
	unsigned short usW_D_sent_length;
	unsigned short usW_C_count = 0;
	unsigned char ubW_D_sentence_end[] = {"END_OF_TEXT\n"};
	unsigned short usW_C_i;
	
	array_reset(ubW_D_word, 10);
	array_reset(ubW_D_sent, 1000);
	
	usW_D_word_length = s_scan_word(ubW_D_word, 1000);
	
	while(1){
		usW_D_sent_length = s_scan_word(ubW_D_sent, 1000);
		if(serch_word(ubW_D_sentence_end, ubW_D_sent) == 1){
			break;
		}
		
		for(usW_C_i = 0;usW_C_i < usW_D_word_length;usW_C_i++){
			ubW_D_word[usW_C_i] |= 0x60;
		}
		for(usW_C_i = 0;usW_C_i < usW_D_sent_length;usW_C_i++){
			ubW_D_sent[usW_C_i] |= 0x60;
		}
		if(word_length == sent_length){
			usW_C_count += serch_word(ubW_D_word, ubW_D_sent);
		}
		array_reset(ubW_D_sent, usW_D_sent_length);
	}
	
	printf("%d\n", usW_C_count);
	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 s_scan_word(unsigned char * str, unsigned short length_max)
{
	unsigned short usW_C_count_text = COUNT_RESET;  	/* 文字列長カウンタ */
	unsigned short usW_C_i;                         	/* ループ変数 */

	/* 文字列の入力 */
	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;
}

unsigned short serch_word(unsigned char * word, unsigned char * sent)
{
	unsigned int usW_F_frg = 0;
	unsigned int usW_C_i = 0;
	while(1){
		if(*(word + usW_C_i) == '\n'){
			usW_F_frg =1;
		}
		if(*(word + usW_C_i) != *(sent + usW_C_i)){
			break;
		}
		usW_C_i++;
	}
	
	return usW_F_frg;
}


Compiler output:
main.c: In function 'main':
main.c:36:20: error: 'word_length' undeclared (first use in this function); did you mean 'usW_D_word_length'?
   36 |                 if(word_length == sent_length){
      |                    ^~~~~~~~~~~
      |                    usW_D_word_length
main.c:36:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:36:35: error: 'sent_length' undeclared (first use in this function); did you mean 'usW_D_sent_length'?
   36 |                 if(word_length == sent_length){
      |                                   ^~~~~~~~~~~
      |                                   usW_D_sent_length
Language: C

#include<stdio.h>
#include<string.h>
int main()
{
    int c=0,i;
    char W[11],T[1001],*p;
    gets(W);
    for(i=0;W[i];i++)W[i]=tolower(W[i]);
    for(;gets(T),strcmp(T,"END_OF_TEXT");)
    {
        for(i=0;T[i];i++)T[i]=tolower(T[i]);
        p=strtok(T," ");
        while(p!=NULL)
        {
            if(!strcmp(W,p))
                c++;
            p=strtok(NULL," ");
        }
    }
    printf("%d\n",c);
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:7:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    7 |     gets(W);
      |     ^~~~
      |     fgets
main.c:8:27: error: implicit declaration of function 'tolower' [-Wimplicit-function-declaration]
    8 |     for(i=0;W[i];i++)W[i]=tolower(W[i]);
      |                           ^~~~~~~
main.c:3:1: note: include '<ctype.h>' or provide a declaration of 'tolower'
    2 | #include<string.h>
  +++ |+#include <ctype.h>
    3 | int main()
Language: C

#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main()
{
          int c=0,i;
          char W[11],T[1001],*p;
          gets(W);
          for(i=0;W[i];i++)W[i]=tolower(W[i]);
          for(;gets(T),strcmp(T,"END_OF_FILE");)
          {

          for(i=0;T[i];i++)T[i]=tolower(T[i]);
          p=strtok(T," ");
          while(p!=NULL)
          {
                    if(!strcmp(W,p))
                              c++;
                    p=strtok(NULL," ");
          }

          }
           printf("%d\n",c);

}



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

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

int main(){
    char search[21], word[21];
    int count=0;
    int i;
    
    scanf("%s", search);
    while(1){
        scanf(" %s", word);
        if(strcmp(word, "END_OF_TEXT")==0)break;
        for(i=0;word[i]!='\0';i++){
            word[i]=tolower(word[i]);
        }
        if(strcmp(word, search)==0){
            count++;
        }
    }
    printf("%d\n", count);

return 0;


Compiler output:
main.c: In function 'main':
main.c:23:1: error: expected declaration or statement at end of input
   23 | return 0;
      | ^~~~~~
Language: C

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

int main()
{
int i,count=0;
char W[11],T[2000];

scanf("%s\n",W);
char Wa[stlen(W)];
strcpy(Wa,W);
while(1){
scanf("%s",T);
if(T == END_OF_TEXT){
break;
}else if(strcmp(tolower(T),Wa) == 0){
count++;
}
printf("%d\n",count);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'stlen'; did you mean 'strlen'? [-Wimplicit-function-declaration]
   10 | char Wa[stlen(W)];
      |         ^~~~~
      |         strlen
main.c:14:9: error: 'END_OF_TEXT' undeclared (first use in this function)
   14 | if(T == END_OF_TEXT){
      |         ^~~~~~~~~~~
main.c:14:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:17: error: implicit declaration of function 'tolower' [-Wimplicit-function-declaration]
   16 | }else if(strcmp(tolower(T),Wa) == 0){
      |                 ^~~~~~~
main.c:3:1: note: include '<ctype.h>' or provide a declaration of 'tolower'
    2 | #include <string.h>
  +++ |+#include <ctype.h>
    3 | 
main.c:16:25: error: passing argument 1 of 'tolower' makes integer from pointer without a cast [-Wint-conversion]
   16 | }else if(strcmp(tolower(T),Wa) == 0){
      |                         ^
      |                         |
      |                         char *
main.c:16:25: note: expected 'int' but argument is of type 'char *'
main.c:16:17: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   16 | }else if(strcmp(tolower(T),Wa) == 0){
      |                 ^~~~~~~~~~
      |                 |
      |                 int
In file included from main.c:2:
/usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
main.c:21:1: error: expected declaration or statement at end of input
   21 | }
      | ^
Language: C

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

int main(void)
{
int i,count=0;
char W[11],T[2000];

scanf("%s\n",W);
char Wa[stlen(W)];
strcpy(Wa,W);
while(1){
scanf("%s",T);
if(T == "END_OF_TEXT"){
break;
}else if(strcmp(tolower(T),Wa) == 0){
count++;
}
printf("%d\n",count);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'stlen'; did you mean 'strlen'? [-Wimplicit-function-declaration]
   10 | char Wa[stlen(W)];
      |         ^~~~~
      |         strlen
main.c:16:17: error: implicit declaration of function 'tolower' [-Wimplicit-function-declaration]
   16 | }else if(strcmp(tolower(T),Wa) == 0){
      |                 ^~~~~~~
main.c:3:1: note: include '<ctype.h>' or provide a declaration of 'tolower'
    2 | #include <string.h>
  +++ |+#include <ctype.h>
    3 | 
main.c:16:25: error: passing argument 1 of 'tolower' makes integer from pointer without a cast [-Wint-conversion]
   16 | }else if(strcmp(tolower(T),Wa) == 0){
      |                         ^
      |                         |
      |                         char *
main.c:16:25: note: expected 'int' but argument is of type 'char *'
main.c:16:17: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   16 | }else if(strcmp(tolower(T),Wa) == 0){
      |                 ^~~~~~~~~~
      |                 |
      |                 int
In file included from main.c:2:
/usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
main.c:21:1: error: expected declaration or statement at end of input
   21 | }
      | ^
Language: C

#include <stdio.h>
#include <string.h>
 
int main(void)
{
int i,count=0;
char W[11],T[2000];
 
scanf("%s\n",W);
char Wa[stlen(W)];
strcpy(Wa,W);
while(1){
scanf("%s",T);
if(T == "END_OF_TEXT"){
break;
}else if(strcmp(tolower(T),Wa) == 0){
count++;
}
}
printf("%d\n",count);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'stlen'; did you mean 'strlen'? [-Wimplicit-function-declaration]
   10 | char Wa[stlen(W)];
      |         ^~~~~
      |         strlen
main.c:16:17: error: implicit declaration of function 'tolower' [-Wimplicit-function-declaration]
   16 | }else if(strcmp(tolower(T),Wa) == 0){
      |                 ^~~~~~~
main.c:3:1: note: include '<ctype.h>' or provide a declaration of 'tolower'
    2 | #include <string.h>
  +++ |+#include <ctype.h>
    3 | 
main.c:16:25: error: passing argument 1 of 'tolower' makes integer from pointer without a cast [-Wint-conversion]
   16 | }else if(strcmp(tolower(T),Wa) == 0){
      |                         ^
      |                         |
      |                         char *
main.c:16:25: note: expected 'int' but argument is of type 'char *'
main.c:16:17: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   16 | }else if(strcmp(tolower(T),Wa) == 0){
      |                 ^~~~~~~~~~
      |                 |
      |                 int
In file included from main.c:2:
/usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
Language: C

#include <stdio.h>
#include <string.h>
   
int main(void)
{
int i,count=0;
char W[11],T[2000];
   
scanf("%s\n",W);
char Wa[strlen(W)];
strcpy(Wa,W);

while(1){
scanf("%s",T);
if(T == "END_OF_TEXT"){
break;
}else if(isalfa(T)){
if(strcmp(tolower(T),Wa) == 0){
count++;
}
}
}
printf("%d\n",count);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:17:10: error: implicit declaration of function 'isalfa' [-Wimplicit-function-declaration]
   17 | }else if(isalfa(T)){
      |          ^~~~~~
main.c:18:11: error: implicit declaration of function 'tolower' [-Wimplicit-function-declaration]
   18 | if(strcmp(tolower(T),Wa) == 0){
      |           ^~~~~~~
main.c:3:1: note: include '<ctype.h>' or provide a declaration of 'tolower'
    2 | #include <string.h>
  +++ |+#include <ctype.h>
    3 | 
main.c:18:19: error: passing argument 1 of 'tolower' makes integer from pointer without a cast [-Wint-conversion]
   18 | if(strcmp(tolower(T),Wa) == 0){
      |                   ^
      |                   |
      |                   char *
main.c:18:19: note: expected 'int' but argument is of type 'char *'
main.c:18:11: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   18 | if(strcmp(tolower(T),Wa) == 0){
      |           ^~~~~~~~~~
      |           |
      |           int
In file included from main.c:2:
/usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
Language: C

#include <stdio.h>
#include <string.h>
#include <ctype.h>
    
int main(void)
{
int i,count=0;
char W[11],T[2000];
    
scanf("%s\n",W);
char Wa[strlen(W)];
strcpy(Wa,W);
 
while(1){
scanf("%s",T);
if(T == "END_OF_TEXT"){
break;
}else if(isalfa(T)){
if(strcmp(tolower(T),Wa) == 0){
count++;
}
}
}
printf("%d\n",count);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:18:10: error: implicit declaration of function 'isalfa'; did you mean 'isalpha'? [-Wimplicit-function-declaration]
   18 | }else if(isalfa(T)){
      |          ^~~~~~
      |          isalpha
main.c:19:19: error: passing argument 1 of 'tolower' makes integer from pointer without a cast [-Wint-conversion]
   19 | if(strcmp(tolower(T),Wa) == 0){
      |                   ^
      |                   |
      |                   char *
In file included from main.c:3:
/usr/include/ctype.h:122:25: note: expected 'int' but argument is of type 'char *'
  122 | extern int tolower (int __c) __THROW;
      |                     ~~~~^~~
main.c:19:11: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   19 | if(strcmp(tolower(T),Wa) == 0){
      |           ^~~~~~~~~~
      |           |
      |           int
In file included from main.c:2:
/usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
Language: C

#include <stdio.h>
#include <string.h>
#include <ctype.h>
       
int main(void)
{
int i,count=0;
char W[11],T[2000];
       
scanf("%s\n",W);
char Wa[strlen(W)];
strcpy(Wa,W);
    
while(1){
scanf(" %s",T);
if(strcmp(T,END_OF_TEXT) == 0){
break;
}else if(isalpha(T)){
if(strcmp(tolower(T),Wa) == 0){
count++;
}
}
}
printf("%d\n",count);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:16:13: error: 'END_OF_TEXT' undeclared (first use in this function)
   16 | if(strcmp(T,END_OF_TEXT) == 0){
      |             ^~~~~~~~~~~
main.c:16:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:19: error: passing argument 1 of 'tolower' makes integer from pointer without a cast [-Wint-conversion]
   19 | if(strcmp(tolower(T),Wa) == 0){
      |                   ^
      |                   |
      |                   char *
In file included from main.c:3:
/usr/include/ctype.h:122:25: note: expected 'int' but argument is of type 'char *'
  122 | extern int tolower (int __c) __THROW;
      |                     ~~~~^~~
main.c:19:11: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   19 | if(strcmp(tolower(T),Wa) == 0){
      |           ^~~~~~~~~~
      |           |
      |           int
In file included from main.c:2:
/usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
Language: C

#include <string.h>

char *gets(char *s);

int strCaseCmp(char *s1, char *s2)
{
//	printf("s1:len %d, %s, s2:len %d, %s\n", strlen(s1), s1, strlen(s2), s2);
	while (*s1 && *s2 && tolower(*s1) == tolower(*s2)) s1++, s2++;
	if (*s1 == 0 && *s2 == 0) return 0;
	return 1;
}

int main()
{
	char W[20], T[1010];
	char *p0, *p1, c;
	int cnt;

	gets(W);
	cnt = 0;
	while (1) {
		gets(T);
		if (!strcmp(T, "END_OF_TEXT")) break;
		p0 = T;
		while (*p0) {
			while (isspace(*p0)) p0++;
			if (*p0) {
				p1 = p0;
				while (*p1 && !isspace(*p1)) p1++;
				c = *p1, *p1 = 0;
				if (!strCaseCmp(W, p0)) cnt++;
				*p1 = c;
				p0 = p1;
			}
		}
	}
	printf("%d\n", cnt);
	return 0;



Compiler output:
main.c: In function 'strCaseCmp':
main.c:8:30: error: implicit declaration of function 'tolower' [-Wimplicit-function-declaration]
    8 |         while (*s1 && *s2 && tolower(*s1) == tolower(*s2)) s1++, s2++;
      |                              ^~~~~~~
main.c:2:1: note: include '<ctype.h>' or provide a declaration of 'tolower'
    1 | #include <string.h>
  +++ |+#include <ctype.h>
    2 | 
main.c: In function 'main':
main.c:26:32: error: implicit declaration of function 'isspace' [-Wimplicit-function-declaration]
   26 |                         while (isspace(*p0)) p0++;
      |                                ^~~~~~~
main.c:26:32: note: include '<ctype.h>' or provide a declaration of 'isspace'
main.c:37:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   37 |         printf("%d\n", cnt);
      |         ^~~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'printf'
    1 | #include <string.h>
  +++ |+#include <stdio.h>
    2 | 
main.c:37:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   37 |         printf("%d\n", cnt);
      |         ^~~~~~
main.c:37:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:38:9: error: expected declaration or statement at end of input
   38 |         return 0;
      |         ^~~~~~
Language: C

#include<stdio.h>
#include<string.h>
int main(){
  int a,i,j,n;
  char w[11],t[1001];
  while(1){
    scanf("%s",w);
    scanf("%s",t);
    if(strcmp(t,"END_OF_TEXT")==0){
      break;
    }
    a=0;
    for(i=0;i<1000;i++){
      if(strcmp(t,"%s",w)==0){
	a++;
      }
    }
  }
  printf("%d\n",a);
  return (0);
}
  

Compiler output:
main.c: In function 'main':
main.c:14:10: error: too many arguments to function 'strcmp'
   14 |       if(strcmp(t,"%s",w)==0){
      |          ^~~~~~
In file included from main.c:2:
/usr/include/string.h:156:12: note: declared here
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |            ^~~~~~
Language: C

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

int main(){
    char w[10], t[1000];
    int i, count = 0;
    
    scanf("%s" w);
    
    while (1) {
        scanf("%s", t);
        
        if(strcmp(t, "END_OF_TEXT" ) == 0) break;
        for (i = 0; i < 1000; i++) t[i] = tolower(t[1]);
        if (strcmp(w, t) == 0) count++;
    }
    
    printf("%d\n", count);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:15: error: expected ')' before 'w'
    9 |     scanf("%s" w);
      |          ~    ^~
      |               )
Language: C

#include <stdio.h>#include <string.h>int main(void){    int count=0,i;    char a[100],b[]={"END_OF_TEXT"},find[10];    scanf("%s",find);    while(1){        scanf("%s",a);                 if(strcmp(a,b)==0)break;        for(i=0;i<100;i++)        {            if(isupper(a[i])!=0)a[i]=tolower(a[i]);        }        if(strcmp(a,find)==0)count++;    }    printf("%d\n",count);return 0;}

Compiler output:
main.c:1:19: warning: extra tokens at end of #include directive
    1 | #include <stdio.h>#include <string.h>int main(void){    int count=0,i;    char a[100],b[]={"END_OF_TEXT"},find[10];    scanf("%s",find);    while(1){        scanf("%s",a);                 if(strcmp(a,b)==0)break;        for(i=0;i<100;i++)        {            if(isupper(a[i])!=0)a[i]=tolower(a[i]);        }        if(strcmp(a,find)==0)count++;    }    printf("%d\n",count);return 0;}
      |                   ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include<iostream>
#include<algorithm>

#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
using namespace std;


int main () {
  string W, T;
  int count = 0;
  cin >> W;

  while (1) {
    cin >> T;
    if (T == "END_OF_TEXT") break;
    
    
    if (T == W) count++;
  }
  
  cout << count << endl;

  return 0;
}

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

import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		String target=scan.next();
		String s;
		int ans=0;
		while(true){
			s=scan.next();
			if(s.equals("END_OF_TEXT")){
				break;
			}
			else{
				if(s.equalsIgnoreCase(target)){
					ans++;
				}
			}
		}
		System.out.println(ans);
		scan.close();
	}
}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:2:1: error: unknown type name 'public'
    2 | public class Main {
      | ^~~~~~
main.c:2:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    2 | public class Main {
      |              ^~~~
Language: C

#include<stdio.h>//文章中にその言葉が使われた数を出す//
#include<stdlib.h>
#include<string.h>

int check(char [],int);

int main (void){

	int i,count=0,counter=0,pod;
	char get,search[100];

	for(i=0;;i++){//探す文字を入力//
		get=getchar();
		if(get=='\n'){
			search[i]='\0';
			break;
		}
		search[i]=get;
		count++;

	}
	while(1){
		pod=check(search,count);
		if(pod==-1)
			break;
		counter+=pod;
	}
	printf("%d\n",counter);
	
	return 0;
}
	
int check(char search[],int count){

	int i,j;
	char word[1000],out[100]="END_OF_TEXT";

	scanf("%s",word);
	if(strcmp(out,word)==0){//入力された文字がEND_OF_TEXTなら-1を返して終了する//
		return -1;
	}
	if(strlen(word)!=strlen(search))//探す文字と文章の単語の長さが違ったら0を返す//
		return 0;
	for(i=0;i<len;i++){
		for(j=0;j<count;j++){
			if(word[i] != search[j]&&
			word[i] + 32 != search[j]&&
			word[i] - 32 != search[j]){//探していた文字の大文字でも小文字でもなかったらflagを建てる//
				return 0;
			}
			else i++;
		}
	}
	return 1;
}

Compiler output:
main.c: In function 'check':
main.c:44:19: error: 'len' undeclared (first use in this function); did you mean 'mblen'?
   44 |         for(i=0;i<len;i++){
      |                   ^~~
      |                   mblen
main.c:44:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main(void)
{
  int k=0,i;
  char s[1000],a[10];
  scanf("%s",a);
  for(i=0;i<10;i++) b[i]=tolower(b[i]);
  while (1){
    scanf("%s",s);
    if(strcmp(s,"END_OF_TEXT") ==0) break;
    for(i=0;i<1000;i++) s[i]=tolower(s[i]);
    if(strcmp(s,a) ==0)k++;
  }
  printf("%d\n",k);
  return 0;
}

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

#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main(void)
{
  int k=0,i;
  char s[1000],a[10];
  scanf("%s",a);
  for(i=0;i<10;i++) a[i]=tolower(b[i]);
  while (1){
    scanf("%s",s);
    if(strcmp(s,"END_OF_TEXT") ==0) break;
    for(i=0;i<1000;i++) s[i]=tolower(s[i]);
    if(strcmp(s,a) ==0)k++;
  }
  printf("%d\n",k);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:34: error: 'b' undeclared (first use in this function)
    9 |   for(i=0;i<10;i++) a[i]=tolower(b[i]);
      |                                  ^
main.c:9:34: note: each undeclared identifier is reported only once for each function it appears in
Language: C

import java.util.Scanner;
import java.lang.Math;
public class Diviation {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);	
		double n = scan.nextInt();
		int[] data = new int[(int)n];
		double sum=0;
		while(n!=0){
			for(int i=0;i<n;i++){
				data[i]=scan.nextInt();
			}
			double ave=average(data,n);
			for(int i=0;i<n;i++){
				sum+=(data[i]*data[i]);
			}
			System.out.println(Math.sqrt(sum/n-ave*ave));
			n=scan.nextInt();
			data = new int[(int)n];
			sum=0;
		}
	}
	public static double average(int[] data,double n){
		double sum=0;
		for(int i=0;i<n;i++){
			sum+=data[i];
		}
		return sum/n;
	}
}

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.Scanner;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.Scanner;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.lang.Math;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.lang.Math;
      |            ^
main.c:3:1: error: unknown type name 'public'
    3 | public class Diviation {
      | ^~~~~~
main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Diviation'
    3 | public class Diviation {
      |              ^~~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
	int count = 0;
	string W;
	string t;
	cin >> W;
	while (cin >> t, t != "END_OF_TEXT")
	{
		transform(t.begin(), t.end(), t.begin(), tolower);
		if (t == W)
		{
			count++;
		}
	}
	cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:26: error: no matching function for call to 'transform(std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, std::__cxx11::basic_string<char>::iterator, <unresolved overloaded function type>)'
   15 |                 transform(t.begin(), t.end(), t.begin(), tolower);
      |                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:4209:5: note: candidate: 'template<class _IIter, class _OIter, class _UnaryOperation> _OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation)'
 4209 |     transform(_InputIterator __first, _InputIterator __last,
      |     ^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4209:5: note:   template argument deduction/substitution failed:
a.cc:15:26: note:   couldn't deduce template parameter '_UnaryOperation'
   15 |                 transform(t.begin(), t.end(), t.begin(), tolower);
      |                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4247:5: note: candidate: 'template<class _IIter1, class _IIter2, class _OIter, class _BinaryOperation> _OIter std::transform(_IIter1, _IIter1, _IIter2, _OIter, _BinaryOperation)'
 4247 |     transform(_InputIterator1 __first1, _InputIterator1 __last1,
      |     ^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4247:5: note:   candidate expects 5 arguments, 4 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:156:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _UnaryOperation> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::transform(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _UnaryOperation)'
  156 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __result,
      | ^~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:156:1: note:   candidate expects 5 arguments, 4 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:162:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator, class _BinaryOperation> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::transform(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator, _BinaryOperation)'
  162 | transform(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
      | ^~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:162:1: note:   candidate expects 6 arguments, 4 provided
Language: C++

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

int main(){
  string w,t;
  int i,count=0;

  cin>>w>>t;
  while(t!="END_OF_TEXT"){
    for(i=0;i<(int)t.size();i++){
      if('A'<=t[i]&&'Z'>=t[i]) t[i]=t[i]-'A'+'a';
    }
    
      if(w==s) count++;
    
    cin>>t;
  }

  cout<<count<<endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 's' was not declared in this scope
   16 |       if(w==s) count++;
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i=0,j,k,count=0,find,val,cal;
    char ch[1001],word[11];

    gets(word);
    int wlen=strlen(word);
    //cout<<wlen;

    gets(ch);
    int len=strlen(ch);
    //cout<<len;

    for(i=0; i<len-wlen; i++)     //char length...
    {
        find=1;
        for(j=0; j<wlen; j++)
        {
            if(ch[i+j]!= word[j])    //highest 4 ta kore compare kora...
            {
                find=0;
                break;
                //cout<<ch[i+j]<<" ";
                //cout<<"#"<<word[j]<<" ";
            }
        }

        if(find==1)
        {
            count++;
        }
    }
    cout<<count<<endl;






}



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

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i=0,j,k,count=0,find,val,cal;
    char ch[1001],word[11];
    char exit[100]="END_OF_TEXT";

    gets(word);
    int wlen=strlen(word);
    //cout<<wlen;

    gets(ch);
    int len=strlen(ch);
    //cout<<len;

    for(i=0; i<len-wlen; i++)     //char length...
    {
        find=1;
        for(j=0; j<wlen; j++)
        {
            if(ch[i+j]!= word[j])    //highest 4 ta kore compare kora...
            {
                find=0;
                break;
                //cout<<ch[i+j]<<" ";
                //cout<<"#"<<word[j]<<" ";
            }
            if(ch[i+j]==exit[i])
            {
                break;
            }
        }

        if(find==1)
        {
            count++;
        }
    }
    cout<<count<<endl;






}



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

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

int main() {
    string w, t;
    cin >> w
    int ans = 0;
    while (cin >> t, t != "END_OF_TEXT")
        if (t == w)
            ans++;
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected ';' before 'int'
    7 |     cin >> w
      |             ^
      |             ;
    8 |     int ans = 0;
      |     ~~~      
a.cc:11:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |             ans++;
      |             ^~~
      |             abs
a.cc:12:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include <iostream>
#include <cmath>
#include <cctype>
#include<cstdio>
#include <string>
//#include<algorithm>
using namespace std;
int main(){
    string s;
    cin>>s;
    transform(s.begin(),s.end(),s.begin(),::toupper);
    int ans=0;
    while(true){
        string u;
        cin>>u;
        if(u=="END_OF_TEXT")break;
        transform(u.begin(),u.end(),u.begin(),::toupper);
        if(s==u)ans++;
        
        
    }
    
    cout<<ans<<endl;
    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'transform' was not declared in this scope
   11 |     transform(s.begin(),s.end(),s.begin(),::toupper);
      |     ^~~~~~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
	const string eot = "END_OF_TEXT";
	string d, w;

	cin >> d;
	unsigned int ans = 0;
	while (cin >> w) {
		if (w.equal(eot))
			break;
		if (w.equal(d))
			ans++;
	}

	cout << ans << endl;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'equal'
   14 |                 if (w.equal(eot))
      |                       ^~~~~
a.cc:16:23: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'equal'
   16 |                 if (w.equal(d))
      |                       ^~~~~
Language: C++

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

int main(){
        string p;
        string in;
        string s[10000] ={""};
        getline(cin, p);
        int n = 0;
        int k = 0;
        int q = 0;
        bool j = true;
        while(1){
                getline(cin,in);
                for(int i = 0; i < in.length(); i++){
                        if(in[i] ==32){
                                k++;
                        }else{
                                s[k] +=tolower(in[i]);
                        }
                }
                for(;q <= k; q++){
                        string l = s[q];
                        
                        
                        transform(s[q].begin(), s[q].end(), l.begin(), ::tolower
);
                        if(l == p){
                                n++;
                        }/*if(s[q] =="END_OF_TEXT"){
                                j = false;*/
                        }
                }
                k++;
                if(j == false)break;
        }
            cout << n << endl;
}
        


Compiler output:
a.cc: In function 'int main()':
a.cc:38:31: error: break statement not within loop or switch
   38 |                 if(j == false)break;
      |                               ^~~~~
a.cc: At global scope:
a.cc:40:13: error: 'cout' does not name a type
   40 |             cout << n << endl;
      |             ^~~~
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

w = gets

count = 0
loop do
  t = gets.split
  if t[0] == "END_OF_TEXT"
    break
  end
  for s in t do
    if w == s.downcase
      count += 1
    end
  end
end

puts count


Compiler output:
a.cc:1:1: error: 'w' does not name a type
    1 | w = gets
      | ^
Language: C++

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

int main(){
int NUM = 1000;
string W;
string T[1000];
int count = 0;
int length = 0;
for(int i = 0; i<1000; i++){
  T[i] = NULL;
}
cin >> W;
while(1){
 for(int i = 0; i<1000; i++){
  cin >> T[i];
  if(T[i] == "END_OF_TEXT"){
    length = i;
    break;
  }
  }
}

for(int i = 0; i<1000; i++){
  if( T[i] == W )count++;
}
cout << count << endl;
return 0;
}


Compiler output:
In file included from /usr/include/stdio.h:34,
                 from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
a.cc: In function 'int main()':
a.cc:15:10: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'long int')
   15 |   T[i] = NULL;
      |          ^~~~
/usr/include/c++/14/bits/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  817 |       operator=(const basic_string& __str)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  828 |       operator=(const _CharT* __s)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  840 |       operator=(_CharT __c)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  858 |       operator=(basic_string&& __str)
      |       ^~~~~~~~
Language: C++

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

int main(){
int NUM = 1000;
string W;
string T;
string END = "END_OF_TEXT";
int count = 0;
cin >> W;

while(1){
cin >> T;

if (T == END) {
  break;
}
string s("aB3Cde_fG");

transform(T.begin(), T.end(), T.begin(), tolower);
if(T == W){
  count++;
}
}
cout << count << endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:1: error: 'transform' was not declared in this scope
   24 | transform(T.begin(), T.end(), T.begin(), tolower);
      | ^~~~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    string W,T;
    cin >> W;
    int num=0;
    for(cin >> T){
        if(T=="END_OF_TEXT")break;
        if(T==W)num++;
    }
    cout << num <<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected ';' before ')' token
    7 |     for(cin >> T){
      |                 ^
      |                 ;
a.cc:12:5: error: expected primary-expression before 'return'
   12 |     return 0;
      |     ^~~~~~
a.cc:11:24: error: expected ')' before 'return'
   11 |     cout << num <<endl;
      |                        ^
      |                        )
   12 |     return 0;
      |     ~~~~~~              
a.cc:7:8: note: to match this '('
    7 |     for(cin >> T){
      |        ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    string W,T;
    cin >> W;
    int num=0;
    for(cin >> T){
        if(T=="END_OF_TEXT")break;
        if(T==W)num++;
    }
    cout << num;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected ';' before ')' token
    7 |     for(cin >> T){
      |                 ^
      |                 ;
a.cc:12:5: error: expected primary-expression before 'return'
   12 |     return 0;
      |     ^~~~~~
a.cc:11:17: error: expected ')' before 'return'
   11 |     cout << num;
      |                 ^
      |                 )
   12 |     return 0;
      |     ~~~~~~       
a.cc:7:8: note: to match this '('
    7 |     for(cin >> T){
      |        ^