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

#include <iostream>
#include <string.h>
#include <ctype.h>
#include <stdio.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:14:39: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   14 |                 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)
      |                       ~~~~~~~~~~~~^~~
Language: C++

#include <iostream>
#include <string.h>
#include <ctype.h>
 
using namespace std;
int main() {
	string S;
	int f=0;
	while(cin>>S){
		if(f++){cout<<" ";}
 
		for(int i=0; i<S.size; 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:12:34: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   12 |                 for(int i=0; i<S.size; i++){
      |                                ~~^~~~
      |                                      ()
Language: C++

#include <iostream>
#include <string>
 
using namespace std;
int main() {
    // your code goes here
    int a='a', A='A', sa=a-A;
    string S;
    int f=0;
    while(cin>>S){
        if(f++){cout<<" ";}
         
        for(int i=0; i<length(S); i++){
            if(S[i]>=A && S[i]<=A+25){
                S[i]+=sa;
            }else if(S[i]>=a && S[i]<=a+25){
                S[i]-=sa;
            }
        }
        cout<<S;
    }
    cout<<endl;
    return 0;
}

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


#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <ctype.h>
#include <cctype>


int main() {
    std::string str;
    std::string upperstr, lowerstr;
    std::cin >> str;
    int len = str.length();
    char* cstr = new char[len+1];
    memcpy(cstr, str.c_str(), len);
    
    
    int i = 0;
    while (i < str.size()) {
        if (isupper(cstr[i]) != 0) {
            cstr[i] = tolower(cstr[i]);
            i++;
        }
        if (islower(cstr[i]) != 0) {
            cstr[i] = toupper(cstr[i]);
            i++;
        }
    }
    
    std::cout << cstr << std::endl;
    
    delete [] cstr;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'memcpy' was not declared in this scope
   17 |     memcpy(cstr, str.c_str(), len);
      |     ^~~~~~
a.cc:9:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <cctype>
  +++ |+#include <cstring>
    9 |
Language: C++

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <ctype.h>
#include <cctype>


int main() {
    std::string str;
    std::string upperstr, lowerstr;
    std::cin >> str;
    int len = str.length();
    char* cstr = new char[len+1];
    std::memcpy(cstr, str.c_str(), len);
    
    
    int i = 0;
    while (i < str.size()) {
        if (isupper(cstr[i]) != 0) {
            cstr[i] = tolower(cstr[i]);
            i++;
        }
        if (islower(cstr[i]) != 0) {
            cstr[i] = toupper(cstr[i]);
            i++;
        }
    }
    
    std::cout << cstr << std::endl;
    
    delete [] cstr;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: 'memcpy' is not a member of 'std'; did you mean 'wmemcpy'?
   16 |     std::memcpy(cstr, str.c_str(), len);
      |          ^~~~~~
      |          wmemcpy
Language: C++

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <cctype>


int main() {
    std::string str;
    std::string upperstr, lowerstr;
    std::cin >> str;
    int len = str.length();
    char* cstr = new char[len+1];
    std::memcpy(cstr, str.c_str(), len);
    
    
    int i = 0;
    while (i < str.size()) {
        if (isupper(cstr[i]) != 0) {
            cstr[i] = tolower(cstr[i]);
            i++;
        }
        if (islower(cstr[i]) != 0) {
            cstr[i] = toupper(cstr[i]);
            i++;
        }
    }
    
    std::cout << cstr << std::endl;
    
    delete [] cstr;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: 'memcpy' is not a member of 'std'; did you mean 'wmemcpy'?
   16 |     std::memcpy(cstr, str.c_str(), len);
      |          ^~~~~~
      |          wmemcpy
Language: C++

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <cctype>


int main() {
    std::string str;
    std::string upperstr, lowerstr;
    std::cin >> str;
    int len = str.length();
    char* cstr = new char[len+1];
    std::memcpy(cstr, str.c_str(), len);
    
    
    int i = 0;
    while (i < str.size()) {
        if (isupper(cstr[i]) != 0) {
            cstr[i] = tolower(cstr[i]);
            i++;
        }
        if (islower(cstr[i]) != 0) {
            cstr[i] = toupper(cstr[i]);
            i++;
        }
    }
    
    std::cout << cstr << std::endl;
    
    delete [] cstr;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: 'memcpy' is not a member of 'std'; did you mean 'wmemcpy'?
   16 |     std::memcpy(cstr, str.c_str(), len);
      |          ^~~~~~
      |          wmemcpy
Language: C++

#define _USE_MATH_DEFINES

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <utility>
#include <climits>
#include <vector>
#include <map>
#include <queue>
using namespace std;

#define ll long long
const int MOD = 1000000007;//10^9+7
const string SPACE = " ";

ll max(ll a, ll b) {

	if (a > b)return a;
	else return b;

}
double max(double a, double b) {

	if (a > b)return a;
	else return b;

}
//a??¨b?????§?????????

ll min(ll a, ll b) {

	if (a < b)return a;
	else return b;

}
//a??¨b????°??????????

ll avd_i(ll a, ll b) {

	if (a > b)return a - b;
	else return b - a;

}
double avd_d(double a, double b) {

	double re;
	if (a > b)re = a - b;
	else re = b - a;
	return re;

}
//a??¨b???????????¶??????

ll powsur(ll a, ll b, ll p) {

	if (b == 0) {

		return 1;

	}
	else if (b % 2 == 0) {

		ll d = powsur(a, b / 2, p);
		return ((d%p)*(d%p)) % p;

	}
	else {

		return ((a%p)*powsur(a, b - 1, p) % p) % p;

	}

}
//p????´???°,a???b??????p??§?????£?????????

ll CMOD(ll n, ll r, ll p) {

	ll a = 1, b = 1, c = 1, re;
	for (int i = 1; i <= n; i++) {

		a *= i;
		a = a%p;

	}
	for (int i = 1; i <= r; i++) {

		b *= i;
		b = b%p;

	}
	for (int i = 1; i <= n - r; i++) {

		c *= i;
		c = c%p;

	}
	b = powsur(b, p - 2, p);
	c = powsur(c, p - 2, p);
	re = ((a%p)*(b%p)) % p;
	re = ((re%p)*c%p) % p;

	return re;

}
//p????´???°,(nCr)%p

ll gcd(ll a, ll b) {

	if (a > b) {

		ll tmp = a;
		a = b;
		b = tmp;

	}
	ll r;
	r = b%a;
	if (r == 0)return a;
	else return gcd(r, a);

}
//?????§??¬?´???°

ll lcm(ll a, ll b) {

	return (a / gcd(a, b))*b;

}
//????°???¬?????°

int main() {
	
	char c;
	while (1) {

		scanf_s("%c", &c);
		if (c == '\n')break;
		else if (islower(c))printf("%c", toupper(c));
		else if (isupper(c))printf("%c", tolower(c));
		else printf("%c", c);

	}
	cout << endl;

	return 0;
}

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

#include <stdio.h>
using namespace std;

int main() {
	char str[1200];
	int i = 0;
	for (; i < 1200; i++) 
	{
		char in;
		scanf_s("%c", &in);
		if (in == '\n')
			break;
		
		if (in >= 'A'&&in <= 'Z')
			str[i] = in + 32;
		else if (in >= 'a'&&in <= 'z')
			str[i] = in - 32;
		else
			str[i] = in;
		printf("%c", str[i]);
	}
	putchar('\n');
	return 0;
}

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

#include <stdio.h>

int main(void)
{
	char s[1200];
	int a;
	
	a = 0;
	
	gets(s);
	
	while(s[a] != '\0'){
		if(s[a] >= 'a' && s[a] <= 'z'){
			s[a] = s[a] - 0x20;
			printf("%c", s[a]);
		}
		else if(s[a] >= 'A' && s[a] <= 'Z'){
			s[a] = s[a] + 0x20;
			printf("%c", s[a]);
		}
		else {
			printf("%c", s[a]);
		}
		a++;
	}
	
	printf("\n");
	
	return (0);
}

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

#include <stdio.h>
#include <cctype.h>
int isolower(char ch);
int isupper(char ch);
int main(){
  while(){
    scanf("%c",&ch);
    printf("%c",ch);
    if(ch=='\n')break;
  }
  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 <stdio.h>
#include <ctype.h>
int main(){
  chars[1200];
  int i=0;
  char ch;
  while((c=getchar())!=EOF){
    char u_c,l_c;
    u_c=toupper(c);
    l_c=tolower(c);
    if(c!=u_c)s[i]=u_c;
    else if(c!=l_c)s[i]=l_c;
    else s[i]=c;
    i++;
  }
  s[i]='\n';
  printf("%s",s);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'chars' was not declared in this scope; did you mean 'char'?
    4 |   chars[1200];
      |   ^~~~~
      |   char
a.cc:7:10: error: 'c' was not declared in this scope; did you mean 'ch'?
    7 |   while((c=getchar())!=EOF){
      |          ^
      |          ch
a.cc:11:15: error: 's' was not declared in this scope
   11 |     if(c!=u_c)s[i]=u_c;
      |               ^
a.cc:12:20: error: 's' was not declared in this scope
   12 |     else if(c!=l_c)s[i]=l_c;
      |                    ^
a.cc:13:10: error: 's' was not declared in this scope
   13 |     else s[i]=c;
      |          ^
a.cc:16:3: error: 's' was not declared in this scope
   16 |   s[i]='\n';
      |   ^
Language: C++

#include <stdio.h>
#include <ctype.h>
int main(){
  char s[1200];
  int i=0;
  char ch;
  while((c=getchar())!=EOF){
    char u_c,l_c;
    u_c=toupper(c);
    l_c=tolower(c);
    if(c!=u_c)s[i]=u_c;
    else if(c!=l_c)s[i]=l_c;
    else s[i]=c;
    i++;
  }
  s[i]='\n';
  printf("%s",s);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'c' was not declared in this scope; did you mean 'ch'?
    7 |   while((c=getchar())!=EOF){
      |          ^
      |          ch
Language: C++

#include <stdio.h>
#include <stdio.h>
int main(){
  char S[1200];
  int i=0;
  char ch;
  while((C=getchar())!eof){
    char u_C,l_C;
    u_C=toupper(C);
    l_C=tolower(C);
    if(C!=u_C)S[i]=u_C;
    else if(C!=l_C)S[i]=l_C;
    else S[i]=C;
  }
  S[i]='\n';
  printf("%s",S);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'C' was not declared in this scope
    7 |   while((C=getchar())!eof){
      |          ^
a.cc:7:22: error: expected ')' before '!' token
    7 |   while((C=getchar())!eof){
      |        ~             ^
      |                      )
a.cc:7:23: error: 'eof' was not declared in this scope; did you mean 'feof'?
    7 |   while((C=getchar())!eof){
      |                       ^~~
      |                       feof
Language: C++

#include <stdio.h>
#include <stdio.h>
int main(){
  char S[1200];
  int i=0;
  char ch;
  while((ch=getchar())!=EOF){
    char u_ch,l_ch;
    u_ch=toupper(ch);
    l_ch=tolower(ch);
    if(ch!=u_ch)S[i]=u_ch;
    else if(ch!=l_ch)S[i]=l_ch;
    else S[i]=ch;
  }
  S[i]='\n';
  printf("%s",S);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'toupper' was not declared in this scope
    9 |     u_ch=toupper(ch);
      |          ^~~~~~~
a.cc:10:10: error: 'tolower' was not declared in this scope
   10 |     l_ch=tolower(ch);
      |          ^~~~~~~
Language: C++

include <iostream>

int main()
{
	char* s;
	std::cin >> s;
	while (*s) {
		if (65 <= *s && *s <=90) *s++ += 32;
		else if (97 <= *s && *s <=122) *s++ -= 32;
	}
	std::cout << s << '\n';
}

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

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

int main(){
    char a[1200] = {0};
    cin >> a;
    for(int i = 0; a[i] != '\0'; ++i){
        if(islower(a[i])){
            a[i] = toupper(a[i]);
        }else(isupper(a[i])){
            a[i] = tolower(a[i]);
        }
    }
    
    for(int i = 0; a[i] != '\0'; ++i){
        cout << a[i] << flush;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: expected ';' before '{' token
   11 |         }else(isupper(a[i])){
      |                             ^
      |                             ;
Language: C++

#include<iostream>
#include<string.h>
#include<string>
#include<stdio.h>
using namespace std;
int main(){
	char m[1200];
	int j=0;
	char b;
	/*while(1){
		cin>>b;
		//if(b==NULL)m[j]=NULL;
		 m[j]=b;
		if(m[j]=='.')break;
j++;
	}*/
	gets(m);
	int len=strlen(m);
	cout<<m<<endl;
	for(int i=0;i<len;i++){
		int a=(int)m[i];
		if(a>=97&&a<=122){
			a-=32;
		}
		else if(a>=65&&a<=90){
			a+=32;
		}
		cout<<(char)a;
	}
	cout<<endl;
}

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

#include<iostream>
#include<string.h>
#include<stdio.h>
using namespace std;
int main(){
	char m[1200];
	int j=0;
	char b;
	gets(m);
	int len=strlen(m);
	//cout<<m<<endl;
	for(int i=0;i<len;i++){
		int a=(int)m[i];
		if(a>=97&&a<=122){
			a-=32;
		}
		else if(a>=65&&a<=90){
			a+=32;
		}
		cout<<(char)a;
	}
	cout<<endl;
}

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

#include <iostream>
#include <cstdio>
#include <iomanip>
#include <string>
#include<algorithm>
#include<cctype>

using namespace std;
const int M = 100000;
const double pi = 3.141592653589;

int sum(int n, int array[]) {

	int sum = 0;
	for (int i = 0; i < n; i++) {
		sum += array[i];
	}
	return sum;
}

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

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

#include<cstdio>
#include<cctype>

using namespace std;

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:9:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    9 |                 scanf_s("%c",&ch);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include <iostream>
#include <cstdio>
#include <cctype>
using namespace std;
int main()
{
	char s;
	while(1) {
		scanf_s("%c",&s);//cin?????¨??????'\n'??????????????????????????????????????£???
		
		if (isalpha(s)) {
			if (isupper(s)) printf("%c",tolower(s));
			else printf("%c",toupper(s));//cout?????¨int?????§???????????????

		} else printf("%c",s);
		
		if (s == '\n') break;
	}
	
	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",&s);//cin?????¨??????'\n'??????????????????????????????????????£???
      |                 ^~~~~~~
      |                 scanf
Language: C++

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

int main(){
	char ch[1200];
	int i=0;

	while (1){
		i++;
		scanf_s("%c", &ch[i]);

		if (isupper(ch[i])){
			ch[i] = tolower(ch[i]);
		}
		else if (islower(ch[i])){
			ch[i] = toupper(ch[i]);
		}

		if (ch[i] == '\n')break;
		cout << ch[i];
	}



	return 0;
}

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

#include <stdio.h>

int main(void)
{
	char string[1200];
	int i=0;
	int qty=0;
	
	gets(string);
	
	while(string[i]!='\0')
	{
		qty++;
		i++;
	}
	
	for(i=0;i<=qty;i++)
	{
		if('A' <= string[i] && string[i] <= 'Z')
		{
			string[i] += ((int)('a') - ('A'));
		}
		else if('a' <= string[i] && string[i] <= 'z')
		{
			string[i] -= ((int)('a') - ('A'));
		}
	}
	
	printf("%s\n",string);
	
	return 0;
}

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

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

int main() {
	char word;
	std::string str;
	std::getline(std::cin, str);
	for (int i = 0; i < sizeof(str); i++) {
		if (static_cast<bool>(islower(str[i])) == true) {
			word = static_cast<char>(toupper(str[i]));
			std::cout << word;
		}
		else if (static_cast<bool>(isupper(str[i])) == true) {
			word = static_cast<char>(tolower(str[i]));
			std::cout << word;
		}
		else  if (str[i] == '\n') {
			break;
		}
		else {
			std::cout << str[i];
		}
	}

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

#include <iostream>
#include <cctype>
#include <string>
int main(){
char std, word;
	while(1) {
		std::cin >> str;
		if (static_cast<bool>(islower(str)) == true) {
			word = static_cast<char>(toupper(str));
			std::cout << word;
		}
		else if (static_cast<bool>(isupper(str)) == true) {
			word = static_cast<char>(tolower(str));
			std::cout << word;
		}
		else  if (str == '\n' || str == NULL) {
			break;
		}
		else  if (str == ' ') {
			std::cout << str;
		}
		else {
			std::cout << str;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: 'str' was not declared in this scope; did you mean 'std'?
    7 |                 std::cin >> str;
      |                             ^~~
      |                             std
Language: C++

#include <stdio.h>

int main(void)
{
	char string[1200];
	int i=0;
	int qty=0;
	
	gets(string);
	
	while(string[i]!='\0')
	{
		qty++;
		i++;
	}
	
	for(i=0;i<=qty;i++)
	{
		if('A' <= string[i] && string[i] <= 'Z')
		{
			string[i] += ((int)('a') - ('A'));
		}
		else if('a' <= string[i] && string[i] <= 'z')
		{
			string[i] -= ((int)('a') - ('A'));
		}
	}
	
	printf("%s\n",string);
	
	return 0;
}


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

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

int main(){
    char letter;
    cin >> letter;
while (letter != ".") {
    if(islower(letter)){
        letter = toupper(letter);
}else {
letter = tolower(letter);
}
        cout << letter;
    }

   }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 | while (letter != ".") {
      |        ~~~~~~~^~~~~~
a.cc: At global scope:
a.cc:19:5: error: expected unqualified-id before 'return'
   19 |     return 0;
      |     ^~~~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

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

int main(){
    char letter;
    cin >> letter;
while (letter != '.') {
    if(islower(letter)){
        letter = toupper(letter);
}else {
letter = tolower(letter);
}
        cout << letter;
    }

   }

    return 0;
}


Compiler output:
a.cc:19:5: error: expected unqualified-id before 'return'
   19 |     return 0;
      |     ^~~~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

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

int main(){
    int i, len;
    char str[256];
    gets(str);
    len = strlen(str);

    for (i = 0; i < len ; i++) {
        if (str[i] >= 'a' && str[i] <= 'z') {
            str[i] = str[i] - 0x20;
        } else if (str[i] >= 'A' && str[i] <= 'Z') {
            str[i] = str[i] + 0x20;
        } else {
            // 変換不要
        }
    }
    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>
#include <string.h>

int main(){
    int i, len;
    char str[256];
    gets_s(str, 256);
    len = strlen(str);

    for (i = 0; i < len ; i++) {
        if (str[i] >= 'a' && str[i] <= 'z') {
            str[i] = str[i] - 0x20;
        } else if (str[i] >= 'A' && str[i] <= 'Z') {
            str[i] = str[i] + 0x20;
        } else {
            // 変換不要
        }
    }
    printf("%s\n", str);
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'gets_s' was not declared in this scope
    7 |     gets_s(str, 256);
      |     ^~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
    char c[1800]; gets(c);

    for (int i = 0; i < strlen(c); ++i)
    {
        if ((int)c[i] <= 90 && (int)c[i] >= 65)
            c[i] = (char)((int)c[i] + 32);
        else if ((int)c[i] <= 122 && (int)c[i] >= 97)
            c[i] = (char)((int)c[i] - 32);
    }
    cout << c << '\n';
    return 0;
}



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

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

const int ch_MAX = 1200;
char ch[ch_MAX],CH[ch_MAX];

int input(){
	int length = 0;
	for (;; length++){
		scanf_s("%c",&ch[length]);
		if (ch[length] == '\n')break;
	}
	return length;
}

void changeCH(int length){
	for (int i = 0; i < length; i++){
		bool flag = islower(ch[i]);
		if (flag==true)CH[i] = toupper(ch[i]);
		else CH[i] = tolower(ch[i]);
		cout << CH[i];
	}
	cout << endl;
}

int main(){
	int length;
	
	length = input();

	changeCH(length);

	return 0;
}


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

/*
与えられた文字列の小文字と大文字を入れ替えるプログラムを
作成してください。

Input
文字列が1行に与えられます。

Output
与えられた文字列の小文字と大文字を入れ替えた文字列を出力して下さい。
アルファベット以外の文字はそのまま出力して下さい。
*/

#include <cstdio>
#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: In function 'int main()':
a.cc:23:37: error: expected ';' before '}' token
   23 |       else printf("%c", tolower(ch))
      |                                     ^
      |                                     ;
   24 |     } else printf("%c", ch);
      |     ~                                
a.cc:26:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |     if (ch == "\n") break;
      |         ~~~^~~~~~~
Language: C++

/*
与えられた文字列の小文字と大文字を入れ替えるプログラムを
作成してください。

Input
文字列が1行に与えられます。

Output
与えられた文字列の小文字と大文字を入れ替えた文字列を出力して下さい。
アルファベット以外の文字はそのまま出力して下さい。
*/

#include <cstdio>
#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: In function 'int main()':
a.cc:26:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |     if (ch == "\n") break;
      |         ~~~^~~~~~~
Language: C++

/*
与えられた文字列の小文字と大文字を入れ替えるプログラムを
作成してください。

Input
文字列が1行に与えられます。

Output
与えられた文字列の小文字と大文字を入れ替えた文字列を出力して下さい。
アルファベット以外の文字はそのまま出力して下さい。
*/

#include <cstdio>
#include <string>
#include <cctype>

int main(){
  string 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: In function 'int main()':
a.cc:18:3: error: 'string' was not declared in this scope
   18 |   string ch;
      |   ^~~~~~
a.cc:18:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from a.cc:14:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:21:18: error: 'ch' was not declared in this scope
   21 |     scanf("%c", &ch);
      |                  ^~
Language: C++

#include <iostream>

using namespace std;

struct tochange{
 int operator()(int word){
   int result;

   if (isupper(word) != 0) {
     result=tolower(word);
   } else {
     result=toupper(word);
   }
   return result;
 }
};

int main(){
  string s;
  cin >> s;
  //getline(cin, s);
  std::transform(s.cbegin(), s.cend(), s.begin(), tochange());
  cout << s;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:8: error: 'transform' is not a member of 'std'
   22 |   std::transform(s.cbegin(), s.cend(), s.begin(), tochange());
      |        ^~~~~~~~~
Language: C++

#include <iostream>

using namespace std;

struct tochange{
 int operator()(int word){
   int result;

   if (isupper(word) != 0) {
     result=tolower(word);
   } else {
     result=toupper(word);
   }
   return result;
 }
};

int main(){
  string s;
  cin >> s;
  //getline(cin, s);
  transform(s.cbegin(), s.cend(), s.begin(), tochange());
  cout << s;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:3: error: 'transform' was not declared in this scope
   22 |   transform(s.cbegin(), s.cend(), s.begin(), tochange());
      |   ^~~~~~~~~
Language: C++

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

int main(void)
{
	int   i, leng;
	char a[1200];


	gets(a);
	leng = strlen(a);

	

	for (i = 0; i < leng; i++) {
		if (a[i] >= 0x41 && a[i] <= 0x5A) {
			a[i] = a[i] + 0x20;
			
		}
		else if (a[i] >= 0x61 && a[i] <= 0x7A) {
			a[i] = a[i] - 0x20;
		}
	}


	printf("%s\n", a);

	
	return 0;
}


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

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

int main(void)
{
	int   i, leng;
	char a[1200];


	gets(a);
	
	leng = strlen(a);
	

	for (i = 0; i < leng; i++) {
		if (a[i] >= 0x41 && a[i] <= 0x5A) {
			a[i] = a[i] + 0x20;
			
		}
		else if (a[i] >= 0x61 && a[i] <= 0x7A) {
			a[i] = a[i] - 0x20;
		}
	}


	printf("%s\n", a);

	
	return 0;
}


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

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

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

	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", &ch);
      |                 ^~~~~~~
      |                 scanf
Language: C++

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


int main()
{
	char ch;

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

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

	cout << endl;

    return 0;
}



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

#include <iostream>


int main() {
  char string[1200];
  int ascii_code;

  std::cin.getline(string, sizeof(string));

  for (int i = 0; i < strlen(string); i ++) {
    ascii_code = (int)string[i];
    if (65 <= ascii_code && ascii_code <= 90) {
      ascii_code += 32;
    } else if (97 <= ascii_code && ascii_code <= 122) {
      ascii_code -= 32;
    }
    std::cout << (char)ascii_code;
  }

  std::cout  << std::endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: 'strlen' was not declared in this scope
   10 |   for (int i = 0; i < strlen(string); 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 |
Language: C++

#include<cstdio>
using namespace std;
int main(){
char str;
while(1){
    scanf("%c",&str);
    if(str=='.'){
        printf(".\n");
        break;
    }
    if(str==''){
        printf("\n");
        break;
    }
    if(str==','){
        printf(",");
    }
    else if(str>='a' && str<='z'){
        str=str-32;
        printf("%c",str);
    }else if(str>='A'&& str<='Z'){
        str=str+32;
        printf("%c",str);
    }else{
        printf("%c",str);
    }
}
return 0;
}



Compiler output:
a.cc:11:13: error: empty character constant
   11 |     if(str==''){
      |             ^~
Language: C++

#include<cstdio>
using namespace std;
int main(){
char str;
while(scanf("%c",&str)&& str!=EOF){
   

    else if(str>='a' && str<='z'){
        str=str-32;
        printf("%c",str);
    }else if(str>='A'&& str<='Z'){
        str=str+32;
        printf("%c",str);
    }else{
        printf("%c",str);
    }
}
return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'else' without a previous 'if'
    8 |     else if(str>='a' && str<='z'){
      |     ^~~~
Language: C++

#include<cstdio>
using namespace std;
int main(){
char str;
while(scanf("%c",&str) && str!=EOF){
    else if(str>='a' && str<='z'){
        str=str-32;
        printf("%c",str);
    }else if(str>='A'&& str<='Z'){
        str=str+32;
        printf("%c",str);
    }else{
        printf("%c",str);
    }
}
printf("\n");
return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'else' without a previous 'if'
    6 |     else if(str>='a' && str<='z'){
      |     ^~~~
Language: C++

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

int main(){
    string std;
    
    getline(cin, str);
    
    for(int i=0;i<(int)str.size();++i){
        if( islower(str[i]) ){
            str[i] = toupper(str[i]);
        }else if( isupper(str[i]) ){
            str[i] = tolower(str[i]);
        }
    }
    
    cout << str << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: 'str' was not declared in this scope; did you mean 'std'?
    7 |     getline(cin, str);
      |                  ^~~
      |                  std
Language: C++

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

int main(){
    for(int i= 0;i<(int)str.size();i++){
        if( islower(str[1])){
          str[i] = toupper(str[i]);
         } else if( isupper(str[i]) ){
           str[i]=tolower(str[i]);
         }
     }
     cout<<str<<endl;
     return 0;
}


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

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

int main(){
    for(int i= 0;i<(int)str.size();i++){
        if( islower(str[1])){
          str[i] = toupper(str[i]);
         } else if( isupper(str[i]) ){
           str[i]=tolower(str[i]);
         }
     }
     cout<<str<<endl;
     return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:25: error: 'str' was not declared in this scope; did you mean 'std'?
    5 |     for(int i= 0;i<(int)str.size();i++){
      |                         ^~~
      |                         std
a.cc:12:12: error: 'str' was not declared in this scope; did you mean 'std'?
   12 |      cout<<str<<endl;
      |            ^~~
      |            std
Language: C++

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

int main(){
    for(int i= 0;i<(int)str.size();i++){
        if( islower(str[i])){
          str[i] = toupper(str[i]);
         } else if( isupper(str[i]) ){
           str[i]=tolower(str[i]);
         }
     }
     cout<<str<<endl;
     return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:25: error: 'str' was not declared in this scope; did you mean 'std'?
    5 |     for(int i= 0;i<(int)str.size();i++){
      |                         ^~~
      |                         std
a.cc:12:12: error: 'str' was not declared in this scope; did you mean 'std'?
   12 |      cout<<str<<endl;
      |            ^~~
      |            std
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: 'ch' was not declared in this scope
   10 |         scanf("%c", &ch);
      |                      ^~
a.cc:21:6: error: expected '}' at end of input
   21 |     }
      |      ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

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

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


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

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

int main()
{
    char buf[1250];
    char *p, c;

    gets(buf);
    p = buf;
    while (*p) {
        c = *p++;
        if (isupper(c)) c = tolower(c);
        else if (islower(c)) c = toupper(c);
        putchar(c);
    }
    putchar('\n');
    return 0;
}



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


import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        try ( Scanner sc = new Scanner ( System.in)){
            String line = sc.nextLine();
            String answer = "";
            int length = line.length();
            for ( int i = 0 ; i<length;i++) {
                char ch = line.charAt(i);
                if (Character.isLowerCase(ch)) {
                    ch = Character.toUpperCase(ch);
                } else {
                    ch = Character.toLowerCase(ch);
                }
                answer+=ch;
            }
            System.out.println(answer);
        }
    }
}


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

import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s1 = new sc.nextLine();
        
        sc.close();
        
        String[] strArray1 = new String[str.length()];
        String[] strArray2 = new String[str.length()];
        for (int i = 0; i < str.length(); i++) {
        strArray1[i] = String.valueOf(str.charAt(i));
        }
        for (int i = 0; i < str.length(); i++) {
        strArray2[i] = String.valueOf(str.charAt(i).toLowerCase());
        }
        for (int i = 0; i < str.length(); i++) {
            if(strArray2[i].equals(strArray2[i])){
                strArray1[i] = strArray2[i].toUpperCase();
            }
            
        }
        for (int i = 0; i < strArray1.length(); i++) {
        System.out.print(strArray2[i]);
        }
        
        
    }
}


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

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s1 = new sc.nextLine();
        
        sc.close();
        
        String[] strArray1 = new String[str.length()];
        String[] strArray2 = new String[str.length()];
        for (int i = 0; i < str.length(); i++) {
        strArray1[i] = String.valueOf(str.charAt(i));
        }
        for (int i = 0; i < str.length(); i++) {
        strArray2[i] = String.valueOf(str.charAt(i).toLowerCase());
        }
        for (int i = 0; i < str.length(); i++) {
            if(strArray2[i].equals(strArray2[i])){
                strArray1[i] = strArray2[i].toUpperCase();
            }
            
        }
        for (int i = 0; i < strArray1.length(); i++) {
        System.out.print(strArray2[i]);
        }
        
        
    }
}


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++

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s1 = new sc.nextLine();
        
        sc.close();
        
        String[] strArray1 = new String[str.length()];
        String[] strArray2 = new String[str.length()];
        for (int i = 0; i < str.length(); i++) {
        strArray1[i] = String.valueOf(str.charAt(i));
        }
        for (int i = 0; i < str.length(); i++) {
        strArray2[i] = String.valueOf(str.charAt(i).toLowerCase());
        }
        for (int i = 0; i < str.length(); i++) {
            if(strArray2[i].equals(strArray2[i])){
                strArray1[i] = strArray2[i].toUpperCase();
            }
            
        }
        for (int i = 0; i < strArray1.length(); i++) {
        System.out.print(strArray2[i]);
        }
        
        
    }
}


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:2:1: error: expected unqualified-id before 'public'
    2 | public class Main{
      | ^~~~~~
Language: C++

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


int main() {
	char s[1200];
	int pos = 0;
	gets_s(s, sizeof(char[1200]));
	while (s[pos] != EOF) {
		if (s[pos] >= 'A'&&s[pos] <= 'Z') {
			s[pos] += 'a' - 'A';
		}
		else if (s[pos] >= 'a'&&s[pos] <= 'z') {
			s[pos] += 'A' - 'a';
		}
		pos++;
	}
	printf("%s\n", s);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'gets_s' was not declared in this scope
    8 |         gets_s(s, sizeof(char[1200]));
      |         ^~~~~~
Language: C++

#include<stdio.h>

int main() {
	char s[1200];
	int pos = 0;
	gets_s(s, sizeof(char[1200]));
	while (s[pos] != EOF) {
		if (s[pos] >= 'A'&&s[pos] <= 'Z') {
			s[pos] += 'a' - 'A';
		}
		else if (s[pos] >= 'a'&&s[pos] <= 'z') {
			s[pos] += 'A' - 'a';
		}
		pos++;
	}
	printf("%s\n", s);
	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(s, sizeof(char[1200]));
      |         ^~~~~~
Language: C++

#include<stdio.h>

int main() {
	char s[1200];
	int pos = 0;
	gets_s(s, sizeof(char[1200]));
	while (s[pos] != EOF) {
		if (s[pos] >= 'A'&&s[pos] <= 'Z') {
			s[pos] += 32;
		}
		else if (s[pos] >= 'a'&&s[pos] <= 'z') {
			s[pos] -= 32;
		}
		pos++;
	}
	printf("%s\n", s);
	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(s, sizeof(char[1200]));
      |         ^~~~~~
Language: C++

#include <cstdio>

int main()
{ //受け取る文字列の最大の長さ＋１の配列を用意する
    char s[1201];
    scanf("%[^\n]", s);

    //ヌル文字に遭遇するまでループする
    for (int i = 0; s[i] != '\0'; i++)
    {
        //i番目の文字
        char c = s[i];

        if (c >= 65 && c <= 90)
        {
            s[i] = c + 32;
        }

        else if (c >= 97 && c <= 122)
        {
            s[i] = c - 32;
        }
        printf("%s", s[i]);
    }



Compiler output:
a.cc: In function 'int main()':
a.cc:24:6: error: expected '}' at end of input
   24 |     }
      |      ^
a.cc:4:1: note: to match this '{'
    4 | { //受け取る文字列の最大の長さ＋１の配列を用意する
      | ^
Language: C++

#include<iostream>
using namaspace std;
int main(){
char ch;
cin>>ch;

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

if ('a' <= ch && ch <= 'z'){
cout<<a+32;
}else if('Z' <= ch && ch <= 'Z'){
cout<<a-32;
}else{
cout<<ch;
}
    if ( ch == '\n' ) break;
}

}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namaspace'
    2 | using namaspace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | 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:11:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 | cout<<a+32;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:7: error: 'a' was not declared in this scope
   11 | cout<<a+32;
      |       ^
a.cc:13:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 | cout<<a-32;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:7: error: 'a' was not declared in this scope
   13 | cout<<a-32;
      |       ^
a.cc:15:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 | cout<<ch;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

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

if ('a' <= ch && ch <= 'z'){
cout<<a+32;
}else if('Z' <= ch && ch <= 'Z'){
cout<<a-32;
}else{
cout<<ch;
}
    if ( ch == '\n' ) break;
}

}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'a' was not declared in this scope
   11 | cout<<a+32;
      |       ^
a.cc:13:7: error: 'a' was not declared in this scope
   13 | cout<<a-32;
      |       ^
Language: C++

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

while(1){
    scanf(%c, &ch);

if ('a' <= ch && ch <= 'z'){
cout<<ch+32;
}else if('Z' <= ch && ch <= 'Z'){
cout<<ch-32;
}else{
cout<<ch;
}
    if ( ch == '\n' ) break;
}

}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected primary-expression before '%' token
    8 |     scanf(%c, &ch);
      |           ^
a.cc:8:12: error: 'c' was not declared in this scope; did you mean 'ch'?
    8 |     scanf(%c, &ch);
      |            ^
      |            ch
Language: C++

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




 



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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: 'tolowe' was not declared in this scope; did you mean 'tolower'?
   11 |       else printf("%c", tolowe(ch));
      |                         ^~~~~~
      |                         tolower