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

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

int main() {
  string s;
  cin >> s;
  transform (s.begin (), s.end (), s.begin (), tolower);
  cout << s;
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: 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>)'
    7 |   transform (s.begin (), s.end (), s.begin (), tolower);
      |   ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/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:7:13: note:   couldn't deduce template parameter '_UnaryOperation'
    7 |   transform (s.begin (), s.end (), s.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++

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

int main() {
    char str[1201];
    
    fgets(str, sizeof(str), stdin);
    
    for (int i = 0; i < strlen(str); i++){
        if (str[i] >= 97 && str[i] <= 122)
            str[i] -= 32;
        else if (str[i] >= 65 && str[i] <= 92)
            str[i] += 32;
    }
    cout << str;
    return 0;
}


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

#include<iostream>
using namespace std;

int main (void)
{
	char a[1200];
	int out;
	while ( gets(a)) 
	{
		/*for ( int q = 1; q < 1200; q++)
		{
			scanf("%c" , &a[q]);
			if ( a[q] == '\n') break;
			out = q;
		}*/
		
		for ( int z = 0; a[z] != '\0'; z++)
		{
			if ( a[z] >= 'A' && a[z] <= 'Z')
			{
				printf("%c", a[z] + 32);
				//cout << a[z] - 32;
			}
			else if ( a[z] >= 'a' && a[z] <= 'z')
			{
				printf("%c", a[z] - 32);
				//cout << a[z] + 32;
			}
			else
			{
				printf("%c",a[z]);
			}
		}
		cout << endl;
	}
	return 0;
}


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

#include<iostream>
using namespace std;


int main (void)
{
	char a[1200];
	int out;
	while ( fgets(a, 1200,stdin) )
	{
		/*for ( int q = 1; q < 1200; q++)
		{
			scanf("%c" , &a[q]);
			if ( a[q] == '\n') break;
			out = q;
		}*/
		
		for ( int z = 0; a[z] != '\0'; z++)
		{
			if ( a[z] >= 'A' && a[z] <= 'Z')
			{
				printf("%c", a[z] + 32);
				//cout << a[z] - 32;
			}
			else if ( a[z] >= 'a' && a[z] <= 'z')
			{
				printf("%c", a[z] - 32);
				//cout << a[z] + 32;
			}
			else
			{
				printf("%c"
	},a[z]);
			}
		}
		cout << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:44: error: expected ')' before '}' token
   32 |                                 printf("%c"
      |                                       ~    ^
      |                                            )
   33 |         },a[z]);
      |         ~                                   
a.cc:33:10: error: expected primary-expression before ',' token
   33 |         },a[z]);
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int i=0;
    char m[1200];
    while(1){
        cin >> m[i];
        if(m[i] == "\n"){
            break;
        }
        if(m[i] > 'A'&&m[i] < 'Z'){
            m[i] -= ('A' - 'a');
        }
        else if(m[i] > 'a'&&m[i] < 'z'){
            m[i] += ('A' - 'a');
        }
        i++;
    }
    cout << m <<  endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         if(m[i] == "\n"){
      |            ~~~~~^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int i=0;
    char m[1200];
    while(1){
        cin >> m[i];
        if(m[i] == \n){
            break;
        }
        if(m[i] > 'A'&&m[i] < 'Z'){
            m[i] -= ('A' - 'a');
        }
        else if(m[i] > 'a'&&m[i] < 'z'){
            m[i] += ('A' - 'a');
        }
        i++;
    }
    cout << m <<  endl;
    return 0;
}


Compiler output:
a.cc:8:20: error: stray '\' in program
    8 |         if(m[i] == \n){
      |                    ^
a.cc: In function 'int main()':
a.cc:8:21: error: 'n' was not declared in this scope
    8 |         if(m[i] == \n){
      |                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int i=0;
    string m;
    getline(cin, s);
    for(int i=0;i<(int)m.size();i++){
        if(m[i] > 'A'&&m[i] < 'Z'){
            m[i] -= ('A' - 'a');
        }
        else if(m[i] > 'a'&&m[i] < 'z'){
            m[i] += ('A' - 'a');
        }
    }
    for(int j=0;j<i;j++){
        cout << m;
    }
    cout << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: 's' was not declared in this scope
    6 |     getline(cin, s);
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    string m;
    getline(cin, m);
    for(int i=0;i<(int)m.size();i++){
        if(m[i] > 'A'&&m[i] < 'Z'){
            m[i] -= ('A' - 'a');
        }
        else if(m[i] > 'a'&&m[i] < 'z'){
            m[i] += ('A' - 'a');
        }
    }
    for(int j=0;j<i;j++){
        cout << m;
    }
    cout << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: 'i' was not declared in this scope
   14 |     for(int j=0;j<i;j++){
      |                   ^
Language: C++

#include<stdio.h>
#include<cctype>

int main(){
    char ch[1200];
    char ans_ch[1200];
    scanf("%s",&ch);
    for(int i=0;i<1200;i++){
        if(ch[i]==\0) break;
        if(int isalpha(char ch[i])){
            if(int islower(char ch[i])){
                char ans_ch[i] = int toupper(char ch[i]);
            }else{
                char ans_ch[i] = int tolower(char ch[i]);
            }
        }printf("%c",&ch[i]);
    }
}


Compiler output:
a.cc:9:19: error: stray '\' in program
    9 |         if(ch[i]==\0) break;
      |                   ^
a.cc: In function 'int main()':
a.cc:10:29: error: parameter may not have variably modified type 'char [i]'
   10 |         if(int isalpha(char ch[i])){
      |                             ^~
a.cc:10:16: error: condition declares a function
   10 |         if(int isalpha(char ch[i])){
      |                ^~~~~~~
a.cc:11:33: error: parameter may not have variably modified type 'char [i]'
   11 |             if(int islower(char ch[i])){
      |                                 ^~
a.cc:11:20: error: condition declares a function
   11 |             if(int islower(char ch[i])){
      |                    ^~~~~~~
a.cc:12:34: error: expected primary-expression before 'int'
   12 |                 char ans_ch[i] = int toupper(char ch[i]);
      |                                  ^~~
a.cc:14:34: error: expected primary-expression before 'int'
   14 |                 char ans_ch[i] = int tolower(char ch[i]);
      |                                  ^~~
Language: C++

#include <iostream>
#include <string>
#include <ctype>

using namespace std;

int main()
{
	string s;

	cin >> s;
	for (unsigned int i = 0; i < s.length(); ++i) {
		if (isupper(s[i]))
			s[i] = (char)tolower(s[i]);
		if (islower(s[i]))
			s[i] = (char)toupper(s[i]);
	}
	cout << s << endl;

	return 0;
}



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

#include <iostream>
#include <string>
#include <ctype>

using namespace std;

int main()
{
	string s;

	cin >> s;
	for (unsigned int i = 0; i < s.length(); ++i) {
		if (isupper(s[i]))
			s[i] = tolower(s[i]);
		if (islower(s[i]))
			s[i] = toupper(s[i]);
	}
	cout << s << endl;

	return 0;
}



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

#include <iostream>
#include <string>
#include <ctype>

using namespace std;

int main()
{
	string s;

	readline(cin, s);
	for (unsigned int i = 0; i < s.length(); ++i) {
		if (isupper(s[i]))
			s[i] = tolower(s[i]);
		else if (islower(s[i]))
			s[i] = toupper(s[i]);
	}
	cout << s << endl;

	return 0;
}


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

#include <iostream>
#include <string>
#include <cctype>

using namespace std;

int main()
{
	string s;

	readline(cin, s);
	for (unsigned int i = 0; i < s.length(); ++i) {
		if (isupper(s[i]))
			s[i] = tolower(s[i]);
		else if (islower(s[i]))
			s[i] = toupper(s[i]);
	}
	cout << s << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'readline' was not declared in this scope
   11 |         readline(cin, s);
      |         ^~~~~~~~
Language: C++

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

int main(){
char x,y;
while(1){
cin >> x;
if ( isalpha(x) ) {//アルファベット  
     if ( islower(x) ) {//小文字
          y = toupper(x);
          cout << y;
     } else {//小文字以外
           if ( isupper(x) ) {//大文字
                y = tolower(x);
                cout << y;
           } 
     }
} else {//アルファベット以外
       cout << x[i] ;
}if(x ==  '\n' )break;
}
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:18: error: 'i' was not declared in this scope
   22 |        cout << x[i] ;
      |                  ^
Language: C++

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

using namespace std;

int changeit(char c){
	int n = (int)c;
	if(65 <= n && n <= 90){
		n = n + 32;
	}
	else if(97 <= n && n <= 122){
		n = n - 32;
	}
	return (char)n;
}


Compiler output:
/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 <ctsdio>
using namespace std;
int main(void){
    char ch[1200];
    int i, n = 0;

    for(;;){
        scanf("%c", &ch[n]);
        if(ch[n] == 0) break;

        if('A' <= ch[n] && ch[n] <= 'Z') 
            ch[n] += 32;
        if('a' <= ch[n] && ch[n] <= 'z') 
            ch[n] -= 32;
        
        n++;
    }

    for(i = 0; i < n; i++){
        printf("%c", ch[i]);
    }
    putchar('\n');
    return 0;
}



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

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

int main() {
    char ch;
    
    while(1){
        cin >> 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:4:7: error: expected nested-name-specifier before 'namespase'
    4 | using namespase std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |         cin >> ch;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:17:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |             if (ch == "\n") break;
      |                 ~~~^~~~~~~
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++

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

int main() {
    char ch;
    
    while(1){
        cin >> 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:17:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |             if (ch == "\n") break;
      |                 ~~~^~~~~~~
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++

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

int main() {
    char ch;
    
    while(1){
        cin >> 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:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++

# include<iostream>
# include<cctype.h>
using namespace std;
int main() {
    while(1) {
        char ch;
        cin >> ch;
        if (int isalpha(char ch)==ture) {
            if (int isupper(char ch)==ture) {
                ch = int tolower(char ch)
            } else if (int islower(char ch)==ture) {
                ch = int toupper(char ch)
            }
            cout << ch;
            } else {
                cout << ch;
            }
        }
    }
    return 0;
}


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

# include<iostream>
# include<cctype>
using namespace std;
int main() {
    while(1) {
        char ch;
        cin >> ch;
        if (int isalpha(char ch)==ture) {
            if (int isupper(char ch)==ture) {
                ch = int tolower(char ch)
            } else if (int islower(char ch)==ture) {
                ch = int toupper(char ch)
            }
            cout << ch;
            } else {
                cout << ch;
            }
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: condition declares a function
    8 |         if (int isalpha(char ch)==ture) {
      |                 ^~~~~~~
a.cc:9:21: error: condition declares a function
    9 |             if (int isupper(char ch)==ture) {
      |                     ^~~~~~~
a.cc:10:22: error: expected primary-expression before 'int'
   10 |                 ch = int tolower(char ch)
      |                      ^~~
a.cc:11:28: error: condition declares a function
   11 |             } else if (int islower(char ch)==ture) {
      |                            ^~~~~~~
a.cc:12:22: error: expected primary-expression before 'int'
   12 |                 ch = int toupper(char ch)
      |                      ^~~
a.cc: At global scope:
a.cc:20:5: error: expected unqualified-id before 'return'
   20 |     return 0;
      |     ^~~~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

#include<cstdio>
#include<iostream>
#include<cctype>
using namespace std;
int main(){
    char ch;
    while(1){
        scanf("%c",&ch)
    }
    
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before '}' token
    8 |         scanf("%c",&ch)
      |                        ^
      |                        ;
    9 |     }
      |     ~
Language: C++

#include<cstdio>
#include<iostream>
#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));
        }else printf("%c",ch);
        
        if(ch=="\n") break;
    }
    
    
}


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

#include <iostream>
using namespace std;
int main(void){
    int as[1234],n=0;
    char A[1234];
    for(;;){
        cin>>A[n];
        if(A[n]=='\n')break;
        as[n]=A[n];
        if(as[n]/32==2){
            as[n]+=32;
            cout<<(char)as[n];
        }
        else if(as[n]/32==3){
            as[n]-=32;
            cout<<(char)as[n];
        }
        else if(A==' '){
            cout<<" ";
        }
        else{
            cout<<A[n];
        }
        n++;
    }
    cout<<endl;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |         else if(A==' '){
      |                 ~^~~~~
Language: C++

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

int main() {

	char ch[2000];
	scanf("%[^\n]", cs);
	for (int i = 0; ch[i] != '\0'; i++) {
		char c = ch[i];
		if ('a' <= c && c <= 'z') {
			printf("%c", toupper(c));
		}
		else if ('A' <= c && c <= 'Z') {
			printf("%c", tolower(c));
		}
		else {
			printf("%c",c);
		}
	}printf("\n");
		return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: 'cs' was not declared in this scope; did you mean 'ch'?
    9 |         scanf("%[^\n]", cs);
      |                         ^~
      |                         ch
Language: C++

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


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin>>ch;
      |         ^~~
a.cc:10:17: error: 'cout' was not declared in this scope
   10 |                 cout>>ch - ('a' - 'A');
      |                 ^~~~
a.cc:12:17: error: 'cout' was not declared in this scope
   12 |                 cout>>ch -+('a' - 'A');
      |                 ^~~~
Language: C++

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


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin>>ch;
      |         ^~~
a.cc:10:17: error: 'cout' was not declared in this scope
   10 |                 cout<<ch - ('a' - 'A');
      |                 ^~~~
a.cc:12:17: error: 'cout' was not declared in this scope
   12 |                 cout<<ch -+('a' - 'A');
      |                 ^~~~
Language: C++

#include<iostream>
#include<cctype>
using namespace std;
int main(){
    char a;
    cin >>a;
    if(isalpha(a)){
        if(isupper(a)){
            tolower(a);
        if(islower(a)){
            toupper(a);
        cout << a << endl;
    else cout << a << endl;
        }
    cout << a << endl;
    cin >>a;
        }
    return 0;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: expected '}' before 'else'
   13 |     else cout << a << endl;
      |     ^~~~
a.cc:10:23: note: to match this '{'
   10 |         if(islower(a)){
      |                       ^
Language: C++

#include<iostream>
using namespace std;

int main(void){
    char ch;
    while(true){
        cin >> ch;
        if ((ch >= 65)) && (ch <= 80)){
            cout << ch + 32 <<endl;
        }
        else if ((ch >= 97) && (ch <= 122)){
            cout << ch - 32 << endl;
        }
        else if (ch == "\n"){
            break;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:28: error: expected identifier before '(' token
    8 |         if ((ch >= 65)) && (ch <= 80)){
      |                            ^
a.cc:14:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |         else if (ch == "\n"){
      |                  ~~~^~~~~~~
Language: C++

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

int main(void){
    char ch;
    while(true){
        scanf("%c", &ch);
        if ((ch >= 65)) && (ch <= 80)){
            cout << ch + 32 <<endl;
        }
        else if ((ch >= 97) && (ch <= 122)){
            cout << ch - 32 << endl;
        }
        else if (ch == "\n"){
            break;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: error: expected identifier before '(' token
    9 |         if ((ch >= 65)) && (ch <= 80)){
      |                            ^
a.cc:15:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |         else if (ch == "\n"){
      |                  ~~~^~~~~~~
Language: C++

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

int main(void){
    char ch;
    while(true){
        scanf("%c", &ch);
        if ((ch >= 65) && (ch <= 80)){
            cout << ch + 32 <<endl;
        }
        else if ((ch >= 97) && (ch <= 122)){
            cout << ch - 32 << endl;
        }
        else if (ch == "\n"){
            break;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |         else if (ch == "\n"){
      |                  ~~~^~~~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before 'if'
    8 |         scanf("%c",&ch)
      |                        ^
      |                        ;
    9 |         if(ch=='\n')break;
      |         ~~
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))cout<<(char)toupper(ch);
            if(isupper(ch))cout<<(char)tolower(ch);
        }
        else{
            cout<<ch;
        }
        if(ch=='\n')break;
    }
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before 'if'
    8 |         scanf("%c",&ch)
      |                        ^
      |                        ;
    9 |         if(isalpha(ch)){
      |         ~~              
a.cc:13:9: error: 'else' without a previous 'if'
   13 |         else{
      |         ^~~~
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))cout<<(char)toupper(ch);
            else if(isupper(ch))cout<<(char)tolower(ch);
        }
        else{
            cout<<ch;
        }
        if(ch=='\n')break;
    }
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before 'if'
    8 |         scanf("%c",&ch)
      |                        ^
      |                        ;
    9 |         if(isalpha(ch)){
      |         ~~              
a.cc:13:9: error: 'else' without a previous 'if'
   13 |         else{
      |         ^~~~
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)){
                cout<<(char)toupper(ch);
            }else if(isupper(ch)){
                cout<<(char)tolower(ch);
            }
        }
        else{
            cout<<ch;
        }
        if(ch=='\n')break;
    }
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before 'if'
    8 |         scanf("%c",&ch)
      |                        ^
      |                        ;
    9 |         if(isalpha(ch)){
      |         ~~              
a.cc:16:9: error: 'else' without a previous 'if'
   16 |         else{
      |         ^~~~
Language: C++

#including<iostream>
using namespace std;
int main(){
    char ch;

    while(1){
        scanf("%c", &ch);
        
        if ( ch == '\n' ) break;
        
        if('a' <= ch && ch <= 'z'){
            ch -= 32;
        }else if('A' <= ch && ch <= 'Z'){
            ch += 32;
        }
        
        cout << ch;
    }
    
    cout << " " ;
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #including; did you mean #include?
    1 | #including<iostream>
      |  ^~~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:9: error: 'scanf' was not declared in this scope
    7 |         scanf("%c", &ch);
      |         ^~~~~
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout << ch;
      |         ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #including<iostream>
a.cc:20:5: error: 'cout' was not declared in this scope
   20 |     cout << " " ;
      |     ^~~~
a.cc:20:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<iostream>
#include<cctype>
using namespace std;
int main() {
    char ch;
    
    scanf("%c", &ch);
    
    if (int isalpha(char ch) == true) {
        
        if (int islower(char ch) == true) {
            
            cout << int toupper(char ch);
            
        } else {
            
            cout << int tolower(char ch);
            
        }
        
    } else {
        
        cout << ch;
        
    }
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: condition declares a function
    9 |     if (int isalpha(char ch) == true) {
      |             ^~~~~~~
a.cc:11:17: error: condition declares a function
   11 |         if (int islower(char ch) == true) {
      |                 ^~~~~~~
a.cc:13:21: error: expected primary-expression before 'int'
   13 |             cout << int toupper(char ch);
      |                     ^~~
a.cc:17:21: error: expected primary-expression before 'int'
   17 |             cout << int tolower(char ch);
      |                     ^~~
Language: C++

#include<iostream>
#include<cctype>
#include<stdio.h>
using namespace std;
int main() {
    char ch;
    
    scanf("%c", &ch);
    
    if (int isalpha(char ch) == true) {
        
        if (int islower(char ch) == true) {
            
            cout << int toupper(char ch);
            
        } else {
            
            cout << int tolower(char ch);
            
        }
        
    } else {
        
        cout << ch;
        
    }
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: condition declares a function
   10 |     if (int isalpha(char ch) == true) {
      |             ^~~~~~~
a.cc:12:17: error: condition declares a function
   12 |         if (int islower(char ch) == true) {
      |                 ^~~~~~~
a.cc:14:21: error: expected primary-expression before 'int'
   14 |             cout << int toupper(char ch);
      |                     ^~~
a.cc:18:21: error: expected primary-expression before 'int'
   18 |             cout << int tolower(char ch);
      |                     ^~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: expected initializer before '(' token
   12 |         if (int isalpha(ch) == true) {
      |                        ^
a.cc:12:24: error: expected ')' before '(' token
   12 |         if (int isalpha(ch) == true) {
      |            ~           ^
      |                        )
a.cc:14:28: error: expected initializer before '(' token
   14 |             if (int islower(ch) == true) {
      |                            ^
a.cc:14:28: error: expected ')' before '(' token
   14 |             if (int islower(ch) == true) {
      |                ~           ^
      |                            )
a.cc:16:25: error: expected primary-expression before 'int'
   16 |                 cout << int toupper(ch);
      |                         ^~~
a.cc:20:25: error: expected primary-expression before 'int'
   20 |                 cout << int tolower(ch);
      |                         ^~~
Language: C++

#include<iostream>
#include<cctype>
#include<stdio.h>
using namespace std;
int main() {
    char ch;
    
    while(1) {
        
        scanf("%c", &ch);
        
        if (ch == '') break;
        
        if (isalpha(ch) == true) {
            
            if (islower(ch) == true) {
                
                cout << toupper(ch);
                
            } else {
                
                cout << tolower(ch);
                
            }
            
        } else {
            
            cout << ch;
        
        }
        
    }
    
   
    
    return 0;
    
}


Compiler output:
a.cc:12:19: error: empty character constant
   12 |         if (ch == '') break;
      |                   ^~
Language: C++

#include<iostream>
#include<cctype>
#include<stdio.h>
using namespace std;
int main() {
    char ch;
    
    while(int i < 1200) {
        
        scanf("%c", &ch);
        
        if (isalpha(ch) == true) {
            
            if (islower(ch) == true) {
                
                cout << toupper(ch);
                
            } else {
                
                cout << tolower(ch);
                
            }
            
        } else {
            
            cout << ch;
        
        }
        
        i += 1;
        
    }
    
   
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: expected initializer before '<' token
    8 |     while(int i < 1200) {
      |                 ^
a.cc:8:16: error: expected ')' before '<' token
    8 |     while(int i < 1200) {
      |          ~     ^~
      |                )
a.cc:8:17: error: expected primary-expression before '<' token
    8 |     while(int i < 1200) {
      |                 ^
Language: C++

#include<iostream>
#include<cctype>
#include<stdio.h>
using namespace std;
int main() {
    char ch;
    
    while(1) {
        
        scanf("%c", &ch);
        
        if (ch == '\n') break;
        
        if (isalpha(ch) == true) {
            
            if (islower(ch) == true) {
                
                cout << toupper(ch);
                
            } else {
                
                cout << tolower(ch);
                
            }
            
        } else {
            
            cout << ch;
        
        }
        
        i += 1;
        
    }
    
   
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:9: error: 'i' was not declared in this scope
   32 |         i += 1;
      |         ^
Language: C++

#including<iostream>
#including<cctype>
using namespace std;
int main(){
    char ch;
    
    while(1){
        scanf("%c", &ch);
        
        if ( ch == '\n' ) break;
        
        if(int isalpha(char ch)){
            if(int islower(char ch)){
                int toupper(char ch)
            }else if(int isupper(char ch)){
                int tolower(char ch)
        }
        
        else{
            cout << ch;
        }
        
    }
    
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #including; did you mean #include?
    1 | #including<iostream>
      |  ^~~~~~~~~
      |  include
a.cc:2:2: error: invalid preprocessing directive #including; did you mean #include?
    2 | #including<cctype>
      |  ^~~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf' was not declared in this scope
    8 |         scanf("%c", &ch);
      |         ^~~~~
a.cc:12:16: error: condition declares a function
   12 |         if(int isalpha(char ch)){
      |                ^~~~~~~
a.cc:13:20: error: condition declares a function
   13 |             if(int islower(char ch)){
      |                    ^~~~~~~
a.cc:15:13: error: expected initializer before '}' token
   15 |             }else if(int isupper(char ch)){
      |             ^
a.cc:15:26: error: condition declares a function
   15 |             }else if(int isupper(char ch)){
      |                          ^~~~~~~
a.cc:17:9: error: expected initializer before '}' token
   17 |         }
      |         ^
a.cc:20:13: error: 'cout' was not declared in this scope
   20 |             cout << ch;
      |             ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #including<iostream>
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#including<iostream>
#including<cctype>
using namespace std;
int main(){
    char ch;
    
    while(1){
        scanf("%c", &ch);
        
        if ( ch == '\n' ) break;
        
        if(int isalpha(char ch)){
            if(int islower(char ch)){
                int toupper(char ch)
            }else if(int isupper(char ch)){
                int tolower(char ch)
            }
        }
        
        else{
            cout << ch;
        }
    }
    
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #including; did you mean #include?
    1 | #including<iostream>
      |  ^~~~~~~~~
      |  include
a.cc:2:2: error: invalid preprocessing directive #including; did you mean #include?
    2 | #including<cctype>
      |  ^~~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf' was not declared in this scope
    8 |         scanf("%c", &ch);
      |         ^~~~~
a.cc:12:16: error: condition declares a function
   12 |         if(int isalpha(char ch)){
      |                ^~~~~~~
a.cc:13:20: error: condition declares a function
   13 |             if(int islower(char ch)){
      |                    ^~~~~~~
a.cc:15:13: error: expected initializer before '}' token
   15 |             }else if(int isupper(char ch)){
      |             ^
a.cc:15:26: error: condition declares a function
   15 |             }else if(int isupper(char ch)){
      |                          ^~~~~~~
a.cc:17:13: error: expected initializer before '}' token
   17 |             }
      |             ^
a.cc:21:13: error: 'cout' was not declared in this scope
   21 |             cout << ch;
      |             ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #including<iostream>
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:39: error: lvalue required as unary '&' operand
   15 |                 printf( "%c", &toupper(ch));
      |                                ~~~~~~~^~~~
a.cc:17:38: error: lvalue required as unary '&' operand
   17 |                 printf("%c", &tolower(ch));
      |                               ~~~~~~~^~~~
Language: C++

#include<cctype>
#include<cstdio>
#include<iostream>


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;
    }
    cout << endl;
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |     cout << endl;
      |     ^~~~
      |     std::cout
In file included from a.cc:3:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:25:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   25 |     cout << endl;
      |             ^~~~
      |             std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<stdio.h>

using namespace std;
int main(){
    char str[1200];
    scanf("%f",str);
    for(int i = 0;i < 1200;i++){
        if(islower(str[i])){
            toupper(str[i]);
        } else{
            tolower(str[i]);
        }
    }
    
    printf("%s",str);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'islower' was not declared in this scope
    8 |         if(islower(str[i])){
      |            ^~~~~~~
a.cc:9:13: error: 'toupper' was not declared in this scope
    9 |             toupper(str[i]);
      |             ^~~~~~~
a.cc:11:13: error: 'tolower' was not declared in this scope
   11 |             tolower(str[i]);
      |             ^~~~~~~
Language: C++

#including<iostream>
#including<cctype>
using namespace std;
int main(){
    char ch;
    
    while(1){
        scanf("%[^\n]%*c", &ch);
        
        if ( ch == '\n' ) break;
        
        if(int isalpha(char ch)){
            if(int islower(char ch)){
                int toupper(char ch)
            }else if(int isupper(char ch)){
                int tolower(char ch)
            }
        }
        
            cout << ch;
        }
    }
    
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #including; did you mean #include?
    1 | #including<iostream>
      |  ^~~~~~~~~
      |  include
a.cc:2:2: error: invalid preprocessing directive #including; did you mean #include?
    2 | #including<cctype>
      |  ^~~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf' was not declared in this scope
    8 |         scanf("%[^\n]%*c", &ch);
      |         ^~~~~
a.cc:12:16: error: condition declares a function
   12 |         if(int isalpha(char ch)){
      |                ^~~~~~~
a.cc:13:20: error: condition declares a function
   13 |             if(int islower(char ch)){
      |                    ^~~~~~~
a.cc:15:13: error: expected initializer before '}' token
   15 |             }else if(int isupper(char ch)){
      |             ^
a.cc:15:26: error: condition declares a function
   15 |             }else if(int isupper(char ch)){
      |                          ^~~~~~~
a.cc:17:13: error: expected initializer before '}' token
   17 |             }
      |             ^
a.cc:20:13: error: 'cout' was not declared in this scope
   20 |             cout << ch;
      |             ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #including<iostream>
a.cc: At global scope:
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#including<iostream>
#including<cctype>
using namespace std;
int main(){
    char ch;
    
    while(1){
        scanf("%[^\n]%", &ch);
        
        if ( ch == '\n' ) break;
        
        if(int isalpha(char ch)){
            if(int islower(char ch)){
                int toupper(char ch)
            }else if(int isupper(char ch)){
                int tolower(char ch)
            }
        }
        
            cout << ch;
        }
    }
    
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #including; did you mean #include?
    1 | #including<iostream>
      |  ^~~~~~~~~
      |  include
a.cc:2:2: error: invalid preprocessing directive #including; did you mean #include?
    2 | #including<cctype>
      |  ^~~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf' was not declared in this scope
    8 |         scanf("%[^\n]%", &ch);
      |         ^~~~~
a.cc:12:16: error: condition declares a function
   12 |         if(int isalpha(char ch)){
      |                ^~~~~~~
a.cc:13:20: error: condition declares a function
   13 |             if(int islower(char ch)){
      |                    ^~~~~~~
a.cc:15:13: error: expected initializer before '}' token
   15 |             }else if(int isupper(char ch)){
      |             ^
a.cc:15:26: error: condition declares a function
   15 |             }else if(int isupper(char ch)){
      |                          ^~~~~~~
a.cc:17:13: error: expected initializer before '}' token
   17 |             }
      |             ^
a.cc:20:13: error: 'cout' was not declared in this scope
   20 |             cout << ch;
      |             ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #including<iostream>
a.cc: At global scope:
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#including<iostream>
#including<cctype>
using namespace std;
int main(){
    char ch;
    
    while(1){
        scanf("%[^\n]", &ch);
        
        if ( ch == '\n' ) break;
        
        if(int isalpha(char ch)){
            if(int islower(char ch)){
                int toupper(char ch)
            }else if(int isupper(char ch)){
                int tolower(char ch)
            }
        }
        
            cout << ch;
        }
    }
    
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #including; did you mean #include?
    1 | #including<iostream>
      |  ^~~~~~~~~
      |  include
a.cc:2:2: error: invalid preprocessing directive #including; did you mean #include?
    2 | #including<cctype>
      |  ^~~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf' was not declared in this scope
    8 |         scanf("%[^\n]", &ch);
      |         ^~~~~
a.cc:12:16: error: condition declares a function
   12 |         if(int isalpha(char ch)){
      |                ^~~~~~~
a.cc:13:20: error: condition declares a function
   13 |             if(int islower(char ch)){
      |                    ^~~~~~~
a.cc:15:13: error: expected initializer before '}' token
   15 |             }else if(int isupper(char ch)){
      |             ^
a.cc:15:26: error: condition declares a function
   15 |             }else if(int isupper(char ch)){
      |                          ^~~~~~~
a.cc:17:13: error: expected initializer before '}' token
   17 |             }
      |             ^
a.cc:20:13: error: 'cout' was not declared in this scope
   20 |             cout << ch;
      |             ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #including<iostream>
a.cc: At global scope:
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^