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

#include <iostream>
#include <cctype>

using namespace std;

int main()
{   
    int  i = 0;
    char ch;
   
    while (1) {              
           cin >> ch;
               
           if (++i <= MAX_LEN) {     
               if (ch != '\0') {                  
                   if (ch >= 'A' && ch <= 'Z') {
                       cout << tolower(ch);  
	           } else if (ch >= 'a' && ch <= 'z') {	           
                       cout << toupper(ch);
                   } else {
                       cout << ch;
                   }              
               } else {
                   cout << endl;
                   break;
               }
           }
    }
        
    return (0);
} 

    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: 'MAX_LEN' was not declared in this scope
   14 |            if (++i <= MAX_LEN) {
      |                       ^~~~~~~
Language: C++

#include <iostream>
#include <cctype>

#define MAX_LEN (1200)

using namespace std;

int main()
{ 
    char* new str[MAX_LEN + 1];
   
    getline(str, MAX_LEN, '\n');

    for (int i = 0; str[i] != '\0') {
         if (str[i] >= 'A' && ch <= 'Z') {
             str[i] = tolower(str[i]);
         } else if (str[i] >= 'a' && ch <= 'z') {
             str[i] = toupper(str[i]);
         }  
    }                               
     
    cout << str << endl;

    delete[] str;     
	   
    return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: expected unqualified-id before 'new'
   10 |     char* new str[MAX_LEN + 1];
      |           ^~~
a.cc:12:13: error: 'str' was not declared in this scope; did you mean 'std'?
   12 |     getline(str, MAX_LEN, '\n');
      |             ^~~
      |             std
a.cc:14:35: error: expected ';' before ')' token
   14 |     for (int i = 0; str[i] != '\0') {
      |                                   ^
      |                                   ;
a.cc:15:31: error: 'ch' was not declared in this scope
   15 |          if (str[i] >= 'A' && ch <= 'Z') {
      |                               ^~
a.cc:24:5: error: type '<type error>' argument given to 'delete', expected pointer
   24 |     delete[] str;
      |     ^~~~~~~~~~~~
Language: C++

#include <iostream>
#include <cctype>

#define MAX_LEN (1200)

using namespace std;

int main()
{ 
    char* str = new char[MAX_LEN + 1];
   
    cin.getline(str, MAX_LEN, '\n');

    for (int i = 0; str[i] != '\0'; i++) {
         if (str[i] >= 'A' && ch <= 'Z') {
             str[i] = tolower(str[i]);
         } else if (str[i] >= 'a' && ch <= 'z') {
             str[i] = toupper(str[i]);
         }  
    }                               
     
    cout << str << endl;

    delete[] str;     
	   
    return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:31: error: 'ch' was not declared in this scope
   15 |          if (str[i] >= 'A' && ch <= 'Z') {
      |                               ^~
Language: C++

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

int main() {
	//char c;
	//scanf_s("%c", &c);//65-90,97-122
	//printf_s("%d", (int)c);

	char str[1200];
	scanf_s("%s", str, _countof(str));
	int i = 0;
	while (str[i] != '\0') {
		if ((int)str[i] >= 65 && (int)str[i] <= 90) {
			str[i] = str[i] + 32;
		}else if ((int)str[i] >= 97 && (int)str[i] <= 122) {
			str[i] = str[i] - 32;
		}
		i++;
	}
	for (int j = 0; j < strlen(str); j++) {
		printf_s("%c", str[j]);
		if (str[j] == '\0') break;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:28: error: '_countof' was not declared in this scope
   11 |         scanf_s("%s", str, _countof(str));
      |                            ^~~~~~~~
a.cc:11:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   11 |         scanf_s("%s", str, _countof(str));
      |         ^~~~~~~
      |         scanf
a.cc:22:17: error: 'printf_s' was not declared in this scope; did you mean 'printf'?
   22 |                 printf_s("%c", str[j]);
      |                 ^~~~~~~~
      |                 printf
Language: C++

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

int main() {
	//char c;
	//scanf_s("%c", &c);//65-90,97-122
	//printf_s("%d", (int)c);

	char str[1200];
	scanf_s("%s", str, _countof(str));
	int i = 0;
	while (str[i] != '\0') {
		if ((int)str[i] >= 65 && (int)str[i] <= 90) {
			str[i] = str[i] + 32;
		}else if ((int)str[i] >= 97 && (int)str[i] <= 122) {
			str[i] = str[i] - 32;
		}
		i++;
	}
	for (int j = 0; j < strlen(str); j++) {
		printf_s("%c", str[j]);
		if (str[j] == '\0') break;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:28: error: '_countof' was not declared in this scope
   13 |         scanf_s("%s", str, _countof(str));
      |                            ^~~~~~~~
a.cc:13:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   13 |         scanf_s("%s", str, _countof(str));
      |         ^~~~~~~
      |         scanf
a.cc:24:17: error: 'printf_s' was not declared in this scope; did you mean 'printf'?
   24 |                 printf_s("%c", str[j]);
      |                 ^~~~~~~~
      |                 printf
Language: C++

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

int main() {
	//char c;
	//scanf_s("%c", &c);//65-90,97-122
	//printf_s("%d", (int)c);

	char str[1200];
	scanf_s("%s", str, 1200);
	int i = 0;
	while (str[i] != '\0') {
		if ((int)str[i] >= 65 && (int)str[i] <= 90) {
			str[i] = str[i] + 32;
		}else if ((int)str[i] >= 97 && (int)str[i] <= 122) {
			str[i] = str[i] - 32;
		}
		i++;
	}
	for (int j = 0; j < strlen(str); j++) {
		printf_s("%c", str[j]);
		if (str[j] == '\0') break;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   13 |         scanf_s("%s", str, 1200);
      |         ^~~~~~~
      |         scanf
a.cc:24:17: error: 'printf_s' was not declared in this scope; did you mean 'printf'?
   24 |                 printf_s("%c", str[j]);
      |                 ^~~~~~~~
      |                 printf
Language: C++

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

int main() {
	//char c;
	//scanf_s("%c", &c);//65-90,97-122
	//printf_s("%d", (int)c);

	char str[1200];
	cin >> str;
	int i = 0;
	while (str[i] != '\0') {
		if ((int)str[i] >= 65 && (int)str[i] <= 90) {
			str[i] = str[i] + 32;
		}else if ((int)str[i] >= 97 && (int)str[i] <= 122) {
			str[i] = str[i] - 32;
		}
		i++;
	}
	for (int j = 0; j < strlen(str); j++) {
		printf_s("%c", str[j]);
		if (str[j] == '\0') break;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'printf_s' was not declared in this scope; did you mean 'printf'?
   24 |                 printf_s("%c", str[j]);
      |                 ^~~~~~~~
      |                 printf
Language: C++

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

int main(void){
	char s;
	while(1){
		cin >>s;
		if(s=='\n'){
			break;
		if(islower(s)==1){
			cout <<toupper(s);
		}else if(isupper(s)==1){
			cout <<tolower(s);
		}
		cout <<s;
	}
    return 0;
}

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

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

int main()
{
	char ch, ch2;
	
	while(1)
	{
		scanf("%c", &ch);
		
		if(islower(ch)){
			ch2 = toupper(ch);
			cout = ch2
		}else{
			ch2 = tolower(ch);
			cout = ch2
		}
		
		if(ch == '\n'){
			break;
		}
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:32: error: no match for 'operator=' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'char')
   16 |                         cout = ch2
      |                                ^~~
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:458:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator=(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  458 |       operator=(basic_ostream&& __rhs)
      |       ^~~~~~~~
/usr/include/c++/14/ostream:458:33: note:   no known conversion for argument 1 from 'char' to 'std::basic_ostream<char>&&'
  458 |       operator=(basic_ostream&& __rhs)
      |                 ~~~~~~~~~~~~~~~~^~~~~
a.cc:19:32: error: no match for 'operator=' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'char')
   19 |                         cout = ch2
      |                                ^~~
/usr/include/c++/14/ostream:458:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator=(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  458 |       operator=(basic_ostream&& __rhs)
      |       ^~~~~~~~
/usr/include/c++/14/ostream:458:33: note:   no known conversion for argument 1 from 'char' to 'std::basic_ostream<char>&&'
  458 |       operator=(basic_ostream&& __rhs)
      |                 ~~~~~~~~~~~~~~~~^~~~~
Language: C++

#include<iostream>
using namespace std;
 
int main() {
    char c;
    while (1) {
        cin.get(c);
        if (c == '\n')break;
        else if ('A' <= c && c <= 'Z')c += 'a' - 'A';
        else if ('a' <= c && c <= 'z')c -= 'a' - 'A';
        cout<<c);
    }
    cout << endl;
        return 0;
}
     

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: expected ';' before ')' token
   11 |         cout<<c);
      |                ^
      |                ;
Language: C++

#include <iostream>
#include <cstdlib>
#include <string>
#include <ctype.h>

using namespace std;

int main() {

	char origin[1200], transformed[1200];

	cin >> origin;

	//cout << strlen(origin) << endl;
	
	//???????????????????????????
	for (int i = 0; i < strlen(origin); i++) {

		//cout << "i=" << i << endl;

		//?¨?????????´???
		if (isupper(origin[i]) == 0 && islower(origin[i]) == 0) {
			//cout << "kigou" << endl;
			//????????????
			//transformed[i] = origin[i];
			cout << (char)origin[i];
		}
		//??§???????????´???
		else if (isupper(origin[i]) != 0) {
			//cout << "upper" << endl;
			//transformed[i] = tolower(origin[i]);
			cout << (char)tolower(origin[i]);
		}
		//?°????????????´???
		else if (islower(origin[i]) != 0) {
			//cout << "lower" << endl;
			//transformed[i] = toupper(origin[i]);
			cout << (char)toupper(origin[i]);
		}

	}

	cout << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:29: error: 'strlen' was not declared in this scope
   17 |         for (int i = 0; i < strlen(origin); i++) {
      |                             ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdlib>
  +++ |+#include <cstring>
    3 | #include <string>
Language: C++

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

static const int MAX_LENGTH = 1200;

int main(void) {
    char* inputLine = new char[MAX_LENGTH];
    cin.getline(inputLine, MAX_LENGTH);

    for(int i=0; i <=strlen(inputLine); i++) {
        if(i == strlen(inputLine)) cout << endl;

        if(0 <= inputLine[i] - 'a' && inputLine[i] - 'a' <= 25) {
            cout << (char)(inputLine[i] - ('a'-'A'));
            continue;
        }
        if(0 <= inputLine[i] - 'A' && inputLine[i] - 'A' <= 25) {
            cout << (char)(inputLine[i] + ('a'-'A'));
            continue;
        }
        cout << inputLine[i];
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: 'strlen' was not declared in this scope
   11 |     for(int i=0; i <=strlen(inputLine); i++) {
      |                      ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <stdio.h>
Language: C++

#include <iostream>
#include <stdio>
using namespace std;
  
int main()
{
	char cha;
	int e;
	while(1) {
		scanf("%c", &cha);
		e = (int)cha;
		if ((e >= 0x61)&&(e <= 0x7a)) {
			e -= 32;
			printf("%c", e);
		}
		else if ((e >= 0x41)&&(e <= 0x5a)) {
			e += 32;
			printf("%c", e);
		}
		else
			printf("%c", e);
		if(cha=='\n') break;
	}
	return 0;

}

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

S = raw_input()
T = ""
for x in S:
    if x.islower():
        T += x.upper()
    elif x.isupper():
        T += x.lower()
    else:
        T += x
print T

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

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

int main()
{
	char ch;

	while (true){
		scanf_s("%c", &ch);

		if (isalpha(ch)){
			if (islower(ch)) printf("%c", toupper(ch));
			else printf("%c", tolower(ch));
		}
		else
			printf("%c", ch);

		if (ch == '\n') break;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   11 |                 scanf_s("%c", &ch);
      |                 ^~~~~~~
      |                 scanf
Language: C++

include <stdio.h>

#include <ctype.h>

int main(void) {
	char c;
	
	do {
		scanf("%c", &c);
		if (isupper(c)) {
			c = c - 'A' + 'a';
		} else if (islower(c)) {
			c = c - 'a' + 'A';
		}
		printf("%c", c);
	} while (c != '\n');
	
	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <stdio.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:9:17: error: 'scanf' was not declared in this scope
    9 |                 scanf("%c", &c);
      |                 ^~~~~
a.cc:15:17: error: 'printf' was not declared in this scope
   15 |                 printf("%c", c);
      |                 ^~~~~~
a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    3 | #include <ctype.h>
  +++ |+#include <cstdio>
    4 |
Language: C++

#include <iostream>
#include <vector>
#include <cctype>	// ??§??????????°??????????????????????????????¨??????
#include "Main.h"
using std::cin;
using std::cout;
using std::endl;
using std::vector;

int main() {
	char b;
	vector<char> a;
	a.resize(120);
	// ??\???
	int i = 0;
	do{
		b = getchar();
		if (islower(b))			a[i] = toupper(b);
		else if (isupper(b))	a[i] = tolower(b);
		i++;
	} while (b != '\n');

	// ??????
	for (int i = 0; i < 120; i++)
	{
		cout << a[i];
	}
	cout << endl;
	return 0;
}

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

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

int main(){
  char tgt;
  while(1) {
    cin >> tgt;
    if ((tgt >= 'a') && (tgt <= 'z') {
      printf("%c", tgt - 32);
    } else if ((tgt >= 'A') && (tgt <= 'Z') {
      printf("%c", tgt + 32);
    } else {
      printf("%c", tgt);
    }
    if (tgt == '\n') {
      break;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:37: error: expected ')' before '{' token
   11 |     if ((tgt >= 'a') && (tgt <= 'z') {
      |        ~                            ^~
      |                                     )
a.cc:21:3: error: expected primary-expression before '}' token
   21 |   }
      |   ^
Language: C++

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

int main(){
  char tgt;
  while(1) {
    cin >> tgt;
    if ((tgt >= 'a') && (tgt <= 'z')) {
      printf("%c", tgt - 32);
    } else if ((tgt >= 'A') && (tgt <= 'Z') {
      printf("%c", tgt + 32);
    } else {
      printf("%c", tgt);
    }
    if (tgt == '\n') {
      break;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:44: error: expected ')' before '{' token
   13 |     } else if ((tgt >= 'A') && (tgt <= 'Z') {
      |               ~                            ^~
      |                                            )
a.cc:21:3: error: expected primary-expression before '}' token
   21 |   }
      |   ^
Language: C++

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

int main(){
 while(1){
  char ch;
  cin >> ch;
  if(ch=='\n') break;
 
  if(isalpha(ch)!=0){
   if(isupper(ch)!=0) cout << tolower(ch);
   else cout << toupper(ch);
  }

  else cout << ch;
 }
 return 0;
}

Compiler output:
a.cc:3:20: error: expected ';' before 'int'
    3 | using namespace std
      |                    ^
      |                    ;
    4 | 
    5 | int main(){
      | ~~~
Language: C++

import java.util.Scanner;

public class Main{

	static Scanner s=new Scanner(System.in);

	public static void main(String __[]){
		input();
		solve();
	}

	private static void input(){
	}

	private static void solve(){
		char c[] = s.nextLine().toCharArray();
		for(int i=0;i<c.length;i++)
			c[i]=c[i]<'Z'
			?Character.toLowerCase(c[i])
			:Character.toUpperCase(c[i]);
		System.out.println(String.valueOf(c));
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main{
      | ^~~~~~
Language: C++

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

int main()
{
	char ch;
	while (1) {
		scanf("%c", &ch);

		if (isalpha(ch)) {
			if (islower(ch)) {
				printf("%c", toupper(ch));
			}

			else {
				printf("%c", tolower(ch));
		}
		
		}
		if (ch == '\n') {
			printf("\n");
			break;
		}
	}
	
	return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
Language: C++

#include<stdio.h>
int main(){
    int i;
    char str[1200];
    scanf("%s", &str);
    for(i=0; i<1200; i++){
        if(str[i]==tolower(str[i])){
            str[i] = toupper(str[i]);
        }else if(str[i]==toupper[i]){
            str[i] = tolower(str[i]);
        }
    }
    printf("%s", str);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: 'tolower' was not declared in this scope
    7 |         if(str[i]==tolower(str[i])){
      |                    ^~~~~~~
a.cc:8:22: error: 'toupper' was not declared in this scope
    8 |             str[i] = toupper(str[i]);
      |                      ^~~~~~~
a.cc:9:26: error: 'toupper' was not declared in this scope
    9 |         }else if(str[i]==toupper[i]){
      |                          ^~~~~~~
Language: C++

#include<stdio.h>
#include<ctype.h>
int main(){
    int i;
    char str[1200];
    scanf("%s", &str);
    for(i=0; i<1200; i++){
        if(str[i]==tolower(str[i])){
            str[i] = toupper(str[i]);
        }else if(str[i]==toupper[i]){
            str[i] = tolower(str[i]);
        }
    }
    printf("%s", str);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:35: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   10 |         }else if(str[i]==toupper[i]){
      |                                   ^
a.cc:10:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         }else if(str[i]==toupper[i]){
      |                  ~~~~~~^~~~~~~~~~~~
Language: C++

#include <cstdio>
#include <cctype>

using namespace std;

int main(void) {
	char c;
	while (1) {
		scanf_s("%c", &c);
		if (c == '\n') break;
		if (islower(c)) {
			c = toupper(c);
		}
		else if (isupper(c)) {
			c = tolower(c);
		}
		printf("%c", c);
	}

	return 0;
}

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

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

int main()
{
    char a;
	cin>>a;
    while (a!= EOF)
    {
        if ('a' <= a && a<= 'z')
        {
			a = toupper(a);
			cout<<a;
        }
		else
		{
			if ('A' <= a && a <= 'Z')
		    {
				a = tolower(a);
				cout<<a;
			}
			else
			{
				cout<<a;
			}
		}
        cin>>a;
    }
    int a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: conflicting declaration 'int a'
   30 |     int a;
      |         ^
a.cc:7:10: note: previous declaration as 'char a'
    7 |     char a;
      |          ^
Language: C++

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

int main()
{
    char a;
	cin>>a;
    while (true)
    {
        if ('a' <= a && a<= 'z')
        {
			a = toupper(a);
			cout<<a;
        }
		else
		{
			if ('A' <= a && a <= 'Z')
		    {
				a = tolower(a);
				cout<<a;
			}
			else
			{
				cout<<a;
			}
		}
        cin>>a;
    }
    int a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: conflicting declaration 'int a'
   30 |     int a;
      |         ^
a.cc:7:10: note: previous declaration as 'char a'
    7 |     char a;
      |          ^
Language: C++

#include<iostream>
#include <cstdio>
#include<cctype>
 
using namespace std;
 
void main(){
     
    char ch;
     ch = getchar();
    while( ch != EOF)
	{
        if(islower(ch))
            ch = toupper(ch);
        else
            ch = tolower(ch);
        cout << ch;
		 ch = getchar();
    }  
   getchar();
}

Compiler output:
a.cc:7:1: error: '::main' must return 'int'
    7 | void main(){
      | ^~~~
Language: C++

#include<stdio.h>
#include<ctype.h>
int main(void){
char ABC;
while(1){
scanf("%c",&ABC);
if (isupper(ABC) != 0){
printf("%c",tolower(ABC));
}else if (islower(ABC) != 0){
printf("%c",toupper(ABC));
}else if (ABC == \n){
printf("\n");
break;
}else{
printf("%c",ABC);
}
return 0;
}

Compiler output:
a.cc:11:18: error: stray '\' in program
   11 | }else if (ABC == \n){
      |                  ^
a.cc: In function 'int main()':
a.cc:11:19: error: 'n' was not declared in this scope
   11 | }else if (ABC == \n){
      |                   ^
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:3:15: note: to match this '{'
    3 | int main(void){
      |               ^
Language: C++

#include <stdio.h>
#include <ctype.h>
int main(void){
    char a;
     
    while(1){
        scanf("%c",&a);
        if(a == '\n')break;
        if(a == tolower(a)){
            printf("%c",(char)toupper(a));
        }else{
            printf("%c",(char)tolower(a));
        }
    }
    printf("\n");
    return 0;

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

#include<stdio.h>
#include<ctype.h>
int main()
{
	char ch,ch2;

	while (1){
		scanf_s("%c", &ch);
		if (islower(ch))ch2=toupper(ch);
		else if (isupper(ch))ch2=tolower(ch);
		else ch2 = ch;
		putchar(ch2);
		if (ch == '\n') break;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |                 scanf_s("%c", &ch);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include <stdio.h>
 
int main(void){
    char Str[1200];
    char *p;

    gets(Str);
    for(p = Str; *p!='\0'; p++){
        if('a' <= *p && *p <= 'z')*p+='A'-'a';
        else if('A' <= *p && *p <= 'Z')*p+='a'-'A';
    }
    printf("%s\n",Str);
 
    return 0;
}

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

#include <stdio.h>
 
int main(void){
    char Str[1200];
    char *p;
    int l;
    int i;
    gets(Str);
    for(p = Str; *p!='\0'; p++){
        if('a' <= *p && *p <= 'z')*p+='A'-'a';
        else if('A' <= *p && *p <= 'Z')*p+='a'-'A';
    }
    printf("%s\n",Str);
 
    return 0;
}

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(Str);
      |     ^~~~
      |     getw
Language: C++

#include<iostream>
#include<cctype>
#include<stdio.h>
using namespace std;
int main(){
	char ch;
	while (1){
		scanf_s("%c", &ch);
		if (isupper(ch)){
			ch=tolower(ch);
			
		}
		else if (islower(ch)){
			ch=toupper(ch);
		}
		cout << ch;

			
		
		if (ch == '/n')break;
	}

	return 0;
}

Compiler output:
a.cc:20:27: warning: multi-character character constant [-Wmultichar]
   20 |                 if (ch == '/n')break;
      |                           ^~~~
a.cc: In function 'int main()':
a.cc:8:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |                 scanf_s("%c", &ch);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include<iostream>
#include<cctype>
#include<stdio.h>
using namespace std;
int main(){
	char ch;
	while (1){
		scanf_s("%c", &ch);
		if (isupper(ch)){
			ch=tolower(ch);
			
		}
		else if (islower(ch)){
			ch=toupper(ch);
		}
		cout << ch;

			
		
		if (ch == '\n')break;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |                 scanf_s("%c", &ch);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include <iostream>
#include <cctype>

using namespace std;

int main()
{
	string in;
	cin >> in;

	transform(in.begin(), in.end(), in.begin(), toupper);
	cout << str << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'transform' was not declared in this scope
   11 |         transform(in.begin(), in.end(), in.begin(), toupper);
      |         ^~~~~~~~~
a.cc:12:17: error: 'str' was not declared in this scope; did you mean 'std'?
   12 |         cout << str << endl;
      |                 ^~~
      |                 std
Language: C++

#include <iostream>
#include <algorithm>
#include <cctype>

using namespace std;

int main()
{
	string in;
	cin >> in;

	transform(in.begin(), in.end(), in.begin(), toupper);
	cout << in << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: 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>)'
   12 |         transform(in.begin(), in.end(), in.begin(), toupper);
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/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:12:18: note:   couldn't deduce template parameter '_UnaryOperation'
   12 |         transform(in.begin(), in.end(), in.begin(), toupper);
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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++

#include <iostream >
#include<cctype>
 
int main(){
  char ch;
 
  while(1){
    scanf("%c", &ch);
    if( isalpha(ch) ){
      if( islower(ch) ) printf("%c", toupper(ch));
      else printf("%c", tolower(ch));
    } else printf("%c", ch);
 
    if( ch == '\n' ) break;
  }
   
  return 0;
}

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

#include<cstdio>
#include<cctype>

int main() {
	char ch;

	while (1) {
		scanf_s("%c", &ch);
		if (isalpha(ch)) {
			if (islower(ch))printf("%c", toupper(ch));
			else printf("%c", tolower(ch));
		}
		else printf("%c", ch);

		if (ch == '\n')break;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |                 scanf_s("%c", &ch);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include<iostream>
#include<ctype.h>
using namespace std;
int main(){
	int i = 0;
	char key;
	char a[1200];
	while (scanf_s("%c", &key)!=EOF){
		if (islower(key)){
			key = toupper(key);
		}
		else if (isupper(key)){
			key = tolower(key);
		}
		a[i] = key;
		i++;
	}
	for (int i2 = 0; i2 < i-1; i2++){
		cout << a[i2];
	}
	cout << endl;
}

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

#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
	char x[1200] = { 0 };
	gets_s(x);
	for (int i = 0; i < 1200; i++){
		switch (x[i]){
		case 'a':x[i] = 'A';
				break;
		case 'b':x[i] = 'B';
			break;
		case 'c':x[i] = 'C';
			break;
		case 'd':x[i] = 'D';
			break;
		case 'e':x[i] = 'E';
			break;
		case 'f':x[i] = 'F';
			break;
		case 'g':x[i] = 'G';
			break;
		case 'h':x[i] = 'H';
			break;
		case 'i':x[i] = 'I';
			break;
		case 'j':x[i] = 'J';
			break;
		case 'k':x[i] = 'K';
			break;
		case 'l':x[i] = 'L';
			break;
		case 'm':x[i] = 'M';
			break;
		case 'n':x[i] = 'N';
			break;
		case 'o':x[i] = 'O';
			break;
		case 'p':x[i] = 'P';
			break;
		case 'q':x[i] = 'Q';
			break;
		case 'r':x[i] = 'R';
			break;
		case 's':x[i] = 'S';
			break;
		case 't':x[i] = 'T';
			break;
		case 'u':x[i] = 'U';
			break;
		case 'v':x[i] = 'V';
			break;
		case 'w':x[i] = 'W';
			break;
		case 'x':x[i] = 'X';
			break;
		case 'y':x[i] = 'Y';
			break;
		case 'z':x[i] = 'Z';
			break;
		case 'A':x[i] = 'a';
			break;
		case 'B':x[i] = 'b';
			break;
		case 'C':x[i] = 'c';
			break;
		case 'D':x[i] = 'd';
			break;
		case 'E':x[i] = 'e';
			break;
		case 'F':x[i] = 'f';
			break;
		case 'G':x[i] = 'g';
			break;
		case 'H':x[i] = 'h';
			break;
		case 'I':x[i] = 'i';
			break;
		case 'J':x[i] = 'j';
			break;
		case 'K':x[i] = 'k';
			break;
		case 'L':x[i] = 'l';
			break;
		case 'M':x[i] = 'm';
			break;
		case 'N':x[i] = 'n';
			break;
		case 'O':x[i] = 'o';
			break;
		case 'P':x[i] = 'p';
			break;
		case 'Q':x[i] = 'q';
			break;
		case 'R':x[i] = 'r';
			break;
		case 'S':x[i] = 's';
			break;
		case 'T':x[i] = 't';
			break;
		case 'U':x[i] = 'u';
			break;
		case 'V':x[i] = 'v';
			break;
		case 'W':x[i] = 'w';
			break;
		case 'X':x[i] = 'x';
			break;
		case 'Y':x[i] = 'y';
			break;
		case 'Z':x[i] = 'z';
			break;
		default:break;

		}
	}
	cout << x << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'gets_s' was not declared in this scope
    6 |         gets_s(x);
      |         ^~~~~~
Language: C++

#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
	char x[1200] = { 0 };
	gets(x);
	for (int i = 0; i < 1200; i++){
		switch (x[i]){
		case 'a':x[i] = 'A';
				break;
		case 'b':x[i] = 'B';
			break;
		case 'c':x[i] = 'C';
			break;
		case 'd':x[i] = 'D';
			break;
		case 'e':x[i] = 'E';
			break;
		case 'f':x[i] = 'F';
			break;
		case 'g':x[i] = 'G';
			break;
		case 'h':x[i] = 'H';
			break;
		case 'i':x[i] = 'I';
			break;
		case 'j':x[i] = 'J';
			break;
		case 'k':x[i] = 'K';
			break;
		case 'l':x[i] = 'L';
			break;
		case 'm':x[i] = 'M';
			break;
		case 'n':x[i] = 'N';
			break;
		case 'o':x[i] = 'O';
			break;
		case 'p':x[i] = 'P';
			break;
		case 'q':x[i] = 'Q';
			break;
		case 'r':x[i] = 'R';
			break;
		case 's':x[i] = 'S';
			break;
		case 't':x[i] = 'T';
			break;
		case 'u':x[i] = 'U';
			break;
		case 'v':x[i] = 'V';
			break;
		case 'w':x[i] = 'W';
			break;
		case 'x':x[i] = 'X';
			break;
		case 'y':x[i] = 'Y';
			break;
		case 'z':x[i] = 'Z';
			break;
		case 'A':x[i] = 'a';
			break;
		case 'B':x[i] = 'b';
			break;
		case 'C':x[i] = 'c';
			break;
		case 'D':x[i] = 'd';
			break;
		case 'E':x[i] = 'e';
			break;
		case 'F':x[i] = 'f';
			break;
		case 'G':x[i] = 'g';
			break;
		case 'H':x[i] = 'h';
			break;
		case 'I':x[i] = 'i';
			break;
		case 'J':x[i] = 'j';
			break;
		case 'K':x[i] = 'k';
			break;
		case 'L':x[i] = 'l';
			break;
		case 'M':x[i] = 'm';
			break;
		case 'N':x[i] = 'n';
			break;
		case 'O':x[i] = 'o';
			break;
		case 'P':x[i] = 'p';
			break;
		case 'Q':x[i] = 'q';
			break;
		case 'R':x[i] = 'r';
			break;
		case 'S':x[i] = 's';
			break;
		case 'T':x[i] = 't';
			break;
		case 'U':x[i] = 'u';
			break;
		case 'V':x[i] = 'v';
			break;
		case 'W':x[i] = 'w';
			break;
		case 'X':x[i] = 'x';
			break;
		case 'Y':x[i] = 'y';
			break;
		case 'Z':x[i] = 'z';
			break;
		default:break;

		}
	}
	cout << x << endl;
	return 0;
}

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

#include<stdio.h>
int main(){
	char x[1200] = { 0 };
	int i;
	gets(x);
	for (i = 0; i < 1200; i++){
		switch (x[i]){
		case 'a':x[i] = 'A';
				break;
		case 'b':x[i] = 'B';
			break;
		case 'c':x[i] = 'C';
			break;
		case 'd':x[i] = 'D';
			break;
		case 'e':x[i] = 'E';
			break;
		case 'f':x[i] = 'F';
			break;
		case 'g':x[i] = 'G';
			break;
		case 'h':x[i] = 'H';
			break;
		case 'i':x[i] = 'I';
			break;
		case 'j':x[i] = 'J';
			break;
		case 'k':x[i] = 'K';
			break;
		case 'l':x[i] = 'L';
			break;
		case 'm':x[i] = 'M';
			break;
		case 'n':x[i] = 'N';
			break;
		case 'o':x[i] = 'O';
			break;
		case 'p':x[i] = 'P';
			break;
		case 'q':x[i] = 'Q';
			break;
		case 'r':x[i] = 'R';
			break;
		case 's':x[i] = 'S';
			break;
		case 't':x[i] = 'T';
			break;
		case 'u':x[i] = 'U';
			break;
		case 'v':x[i] = 'V';
			break;
		case 'w':x[i] = 'W';
			break;
		case 'x':x[i] = 'X';
			break;
		case 'y':x[i] = 'Y';
			break;
		case 'z':x[i] = 'Z';
			break;
		case 'A':x[i] = 'a';
			break;
		case 'B':x[i] = 'b';
			break;
		case 'C':x[i] = 'c';
			break;
		case 'D':x[i] = 'd';
			break;
		case 'E':x[i] = 'e';
			break;
		case 'F':x[i] = 'f';
			break;
		case 'G':x[i] = 'g';
			break;
		case 'H':x[i] = 'h';
			break;
		case 'I':x[i] = 'i';
			break;
		case 'J':x[i] = 'j';
			break;
		case 'K':x[i] = 'k';
			break;
		case 'L':x[i] = 'l';
			break;
		case 'M':x[i] = 'm';
			break;
		case 'N':x[i] = 'n';
			break;
		case 'O':x[i] = 'o';
			break;
		case 'P':x[i] = 'p';
			break;
		case 'Q':x[i] = 'q';
			break;
		case 'R':x[i] = 'r';
			break;
		case 'S':x[i] = 's';
			break;
		case 'T':x[i] = 't';
			break;
		case 'U':x[i] = 'u';
			break;
		case 'V':x[i] = 'v';
			break;
		case 'W':x[i] = 'w';
			break;
		case 'X':x[i] = 'x';
			break;
		case 'Y':x[i] = 'y';
			break;
		case 'Z':x[i] = 'z';
			break;
		default:break;

		}
	}
	puts(x);
	return 0;
}

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

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

int main()
{
    char ch[1200];
    cin >> ch[1200];
    for(int i=0; ch[i]!=?\0; i++){
        if(i==0)
            ch[i] = tolower(ch[i]);
        else{
            if(!islower(ch[i]))
               ch[i] = tolower(ch[i]);
        }
    }
               
    return 0;
}

Compiler output:
a.cc:9:26: error: stray '\' in program
    9 |     for(int i=0; ch[i]!=?\0; i++){
      |                          ^
a.cc: In function 'int main()':
a.cc:9:25: error: expected primary-expression before '?' token
    9 |     for(int i=0; ch[i]!=?\0; i++){
      |                         ^
a.cc:9:28: error: expected ':' before ';' token
    9 |     for(int i=0; ch[i]!=?\0; i++){
      |                            ^
      |                            :
a.cc:9:28: error: expected primary-expression before ';' token
Language: C++

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

int main()
{
    char ch[1200];
    cin >> ch[1200];
    for(int i=0; ch[i]!=?\0; i++){
        if(i==0)
            ch[i] = toupper(ch[i]);
        else{
            if(!islower(ch[i]))
               ch[i] = tolower(ch[i]);
        }
    }
               
    return 0;
}

Compiler output:
a.cc:9:26: error: stray '\' in program
    9 |     for(int i=0; ch[i]!=?\0; i++){
      |                          ^
a.cc: In function 'int main()':
a.cc:9:25: error: expected primary-expression before '?' token
    9 |     for(int i=0; ch[i]!=?\0; i++){
      |                         ^
a.cc:9:28: error: expected ':' before ';' token
    9 |     for(int i=0; ch[i]!=?\0; i++){
      |                            ^
      |                            :
a.cc:9:28: error: expected primary-expression before ';' token
Language: C++

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

int main(){
	char ch;
	while(1){
		scanf("%c",&ch);
		if(ch=='\n'){
			printf("\n");
			break;
		if(islower(ch)) ch=toupper(ch);
		else if(isupper(ch)) ch=tolower(ch);
		cout<<ch;
	}
	return 0;
}

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

#include <stdio.h>
using namespace std;
//---------------------------------------
void henkan(char inp[]);   //?°?????????¨??§???????????\?????????
//---------------------------------------

int main(void)
{
	char inp[1201];
	gets(inp);
	
	henkan(inp);
	
	printf("%s\n",inp);
	
	return 0;
}

//------------------------------------------
void henkan(char inp[])
{	
	for(int i = 0; i < 1200; i++){
		if(inp[i] >= 'A' && inp[i] <= 'Z'){
			inp[i] += 32;
		}
		else if(inp[i] >= 'a' && inp[i] <= 'z'){
			inp[i] -= 32;
		}
	}
}

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

/*
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_8_A
 */
#include <iostream>
#include <string>

using namespace std;

char
SwapCase(const char c)
{
  if (isupper(c)) {
    return tolower(c);
  } else if (islower(c)) {
    return toupper(c);
  }
  return c;
}

int
main()
{
  ios::sync_with_stdio(false);

  string str;
  getline(cin, str);
  transform(str.begin(), str.end(), str.begin(), SwapCase);
  cout << str << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:3: error: 'transform' was not declared in this scope
   27 |   transform(str.begin(), str.end(), str.begin(), SwapCase);
      |   ^~~~~~~~~
Language: C++


#include <algorithm>

using namespace std;

char
SwapCase(const char c)
{
  if (isupper(c)) {
    return tolower(c);
  } else if (islower(c)) {
    return toupper(c);
  }
  return c;
}

int
main()
{
  ios::sync_with_stdio(false);

  string str;
  getline(cin, str);
  transform(str.begin(), str.end(), str.begin(), SwapCase);
  cout << str << endl;

  return 0;
}

Compiler output:
a.cc: In function 'char SwapCase(char)':
a.cc:9:7: error: 'isupper' was not declared in this scope
    9 |   if (isupper(c)) {
      |       ^~~~~~~
a.cc:10:12: error: 'tolower' was not declared in this scope
   10 |     return tolower(c);
      |            ^~~~~~~
a.cc:11:14: error: 'islower' was not declared in this scope
   11 |   } else if (islower(c)) {
      |              ^~~~~~~
a.cc:12:12: error: 'toupper' was not declared in this scope
   12 |     return toupper(c);
      |            ^~~~~~~
a.cc: In function 'int main()':
a.cc:20:3: error: 'ios' has not been declared
   20 |   ios::sync_with_stdio(false);
      |   ^~~
a.cc:22:3: error: 'string' was not declared in this scope
   22 |   string str;
      |   ^~~~~~
a.cc:3:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    2 | #include <algorithm>
  +++ |+#include <string>
    3 | 
a.cc:23:11: error: 'cin' was not declared in this scope
   23 |   getline(cin, str);
      |           ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <algorithm>
  +++ |+#include <iostream>
    3 | 
a.cc:23:16: error: 'str' was not declared in this scope; did you mean 'std'?
   23 |   getline(cin, str);
      |                ^~~
      |                std
a.cc:23:3: error: 'getline' was not declared in this scope
   23 |   getline(cin, str);
      |   ^~~~~~~
a.cc:25:3: error: 'cout' was not declared in this scope
   25 |   cout << str << endl;
      |   ^~~~
a.cc:25:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:18: error: 'endl' was not declared in this scope
   25 |   cout << str << endl;
      |                  ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <algorithm>
  +++ |+#include <ostream>
    3 |
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
char ch;

while(1){
scanf("%c", &ch);
if ( isalpha(ch) ){
if ( isslower(ch) ) printf("%c", toupper(ch));
else printf("%c", tolower(ch));
}else printf("%c", ch);

if ( ch == '\n' ) break;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:6: error: 'isslower' was not declared in this scope; did you mean 'iswlower'?
    9 | if ( isslower(ch) ) printf("%c", toupper(ch));
      |      ^~~~~~~~
      |      iswlower
Language: C++

#include <iostream>

using namespace std;

int change(int c){
  
   if(c >= 65 && c <= 90)
     c += 32;
   else if(c >= 97 && c <= 122)
     c -= 32;

return c;
}

int main(void){

 while(1){

  int c;
  cin >> c;
  
  cout << change(c)


 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:20: error: expected ';' before 'return'
   22 |   cout << change(c)
      |                    ^
      |                    ;
......
   25 |  return 0;
      |  ~~~~~~             
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:15:15: note: to match this '{'
   15 | int main(void){
      |               ^
Language: C++

#include <iostream>

using namespace std;

int change(int c){
  
   if(c >= 65 && c <= 90)
     c += 32;
   else if(c >= 97 && c <= 122)
     c -= 32;

   return c;
}

int main(void){

 while(1){

  int c;
  cin >> c;
  
  cout << change(c);


 return 0;
}

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

#include <iostream>
using namespace std;

int main(){
 char s;
 
 while(1){
  cin >> s ;
  if((s=getchar())==EOF)break;
  if(islower(s))s=toupper(s) ;
  else if(isupper(s))s=tolower(s) ;
  cout << s ;
  if(s=="\n")break;
 }
 cout << endl ;

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |   if(s=="\n")break;
      |      ~^~~~~~
Language: C++

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

int main(){
 char s;
 
 while(1){
  cin >> s ;
  if(isalpha(a)){
   if(islower(s))cout << (char)toupper(s) ;
   else if(isupper(s))cout << (char)tolower(s) ;
  }
  else{
   cout << s ;
  }
  if(s=='\n')break;
 }

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'a' was not declared in this scope
   10 |   if(isalpha(a)){
      |              ^
Language: C++

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

int main(){
 char s;
 
 while(1){
  cin >> s ;
  if(isalpha(a)){
   if(islower(s))cout << (char)toupper(s) ;
   else if(isupper(s))cout << (char)tolower(s) ;
  }
  else{
   cout << s ;
  }
  if(s=='\n')break;

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'a' was not declared in this scope
   10 |   if(isalpha(a)){
      |              ^
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <string>
#include <ctype.h>
 
using namespace std;
int main() {
	// your code goes here
	string S;
	int f=0;
	while(cin>>S){
		if(f++){cout<<" ";}
 
		for(int i=0; i<strlen(S); i++){
			if(S[i]>='A' && S[i]<='Z'){
				S[i]=tolower(S[i]);
			}else if(S[i]>='a' && S[i]<='z'){
				S[i]=toupper(S[i]);
			}
		}
		cout<<S;
	}
	cout<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:32: error: 'strlen' was not declared in this scope
   13 |                 for(int i=0; i<strlen(S); i++){
      |                                ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include <iostream>
#include <string.h>
#include <ctype.h>
 
using namespace std;
int main() {
	// your code goes here
	string S;
	int f=0;
	while(cin>>S){
		if(f++){cout<<" ";}
 
		for(int i=0; i<strlen(S); i++){
			if(S[i]>='A' && S[i]<='Z'){
				S[i]=tolower(S[i]);
			}else if(S[i]>='a' && S[i]<='z'){
				S[i]=toupper(S[i]);
			}
		}
		cout<<S;
	}
	cout<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:39: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   13 |                 for(int i=0; i<strlen(S); i++){
      |                                       ^
      |                                       |
      |                                       std::string {aka std::__cxx11::basic_string<char>}
In file included from a.cc:2:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~