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

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

void shuffle(char *a , int h){
	char tmp[201];
	char mov[201];
	size_t len=strlen(a);
	strcpy(tmp , (const char*)a+h);
	strncpy(mov , a , h);
	mov[h]='\0';
	strcat(tmp , mov);
	strcpy(a , (const char*)tmp);
	return;
}

int main(){
	char card[201]={0};
	char ans[201]={0};
	int i , m;
	int h[100];
	while(1){
		cin>>card;
		m=strlen(card);
		if ( card[0]=='-'&& m==1 ) break;
	cin>>m;
		for(i=0;i<m;i++){
			cin>>h[i];
			shuffle(card , h[i]);
		}
		strcpy(ans , card);
		cout << ans << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'void shuffle(char*, int)':
a.cc:8:20: error: 'strlen' was not declared in this scope
    8 |         size_t len=strlen(a);
      |                    ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
a.cc:9:9: error: 'strcpy' was not declared in this scope
    9 |         strcpy(tmp , (const char*)a+h);
      |         ^~~~~~
a.cc:9:9: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:10:9: error: 'strncpy' was not declared in this scope
   10 |         strncpy(mov , a , h);
      |         ^~~~~~~
a.cc:10:9: note: 'strncpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:12:9: error: 'strcat' was not declared in this scope
   12 |         strcat(tmp , mov);
      |         ^~~~~~
a.cc:12:9: note: 'strcat' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'int main()':
a.cc:24:19: error: 'strlen' was not declared in this scope
   24 |                 m=strlen(card);
      |                   ^~~~~~
a.cc:24:19: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:31:17: error: 'strcpy' was not declared in this scope
   31 |                 strcpy(ans , card);
      |                 ^~~~~~
a.cc:31:17: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<stdio.h>
#include<string.h>
int main(void)
{
	int a,s,d,f,g,h,j,i;
	char z[201],x[201];
	scanf("%s",z);
	while(z[0]!='-'){
		a=strlen(z);
		scanf("%d",&s);
		for(i=0;i<s;i++){
			scanf("%d",&d);
			f=a-d;
			for(j=0;j<d;j++){
				x[f]=z[j];
				f++;
			}
			g=0;
			for(j=d;j<a;j++){
				x[g]=z[j];
				g++;
			}
			for(j=0;j<a;j++){
				z[j]=x[j];
			}
		}
		printf("%s\n",z);
		scanf("%s",z);
	}
	return 0;
}#include<stdio.h>
#include<string.h>
int main(void)
{
	int a,s,d,f,g,h,j,i;
	char z[201],x[201];
	scanf("%s",z);
	while(z[0]!='-'){
		a=strlen(z);
		scanf("%d",&s);
		for(i=0;i<s;i++){
			scanf("%d",&d);
			f=a-d;
			for(j=0;j<d;j++){
				x[f]=z[j];
				f++;
			}
			g=0;
			for(j=d;j<a;j++){
				x[g]=z[j];
				g++;
			}
			for(j=0;j<a;j++){
				z[j]=x[j];
			}
		}
		printf("%s\n",z);
		scanf("%s",z);
	}
	return 0;
}

Compiler output:
a.cc:31:2: error: stray '#' in program
   31 | }#include<stdio.h>
      |  ^
a.cc:31:3: error: 'include' does not name a type
   31 | }#include<stdio.h>
      |   ^~~~~~~
Language: C++

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

int main(){
 int m,h,n = 0;
 string str, str1, str2;

 while(1){
  cin >> str[n];

  if(str[n] == '-') break;
  
  cin >> m;

  for(int i = 0; i < m; i++){
   cin >> h;

   str1 = str[n].substr(0, h);
   str2 = str[n].substr(h, str[n].size() - h);

   str[n] = str[n].replace(0, str2.size(), str2);
   str[n] = str[n].replace(str2.size(), str[n].size() - str.size(), str1);

  }

  n++;
 }
  
 for(int i = 0; i < n; i++){
  cout << str[n];
 }

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:18: error: request for member 'substr' in 'str.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)n))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   20 |    str1 = str[n].substr(0, h);
      |                  ^~~~~~
a.cc:21:18: error: request for member 'substr' in 'str.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)n))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   21 |    str2 = str[n].substr(h, str[n].size() - h);
      |                  ^~~~~~
a.cc:21:35: error: request for member 'size' in 'str.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)n))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   21 |    str2 = str[n].substr(h, str[n].size() - h);
      |                                   ^~~~
a.cc:23:20: error: request for member 'replace' in 'str.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)n))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   23 |    str[n] = str[n].replace(0, str2.size(), str2);
      |                    ^~~~~~~
a.cc:24:20: error: request for member 'replace' in 'str.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)n))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   24 |    str[n] = str[n].replace(str2.size(), str[n].size() - str.size(), str1);
      |                    ^~~~~~~
a.cc:24:48: error: request for member 'size' in 'str.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)n))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   24 |    str[n] = str[n].replace(str2.size(), str[n].size() - str.size(), str1);
      |                                                ^~~~
Language: C++

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

int main(){
	string s;
	while (cin >> s){
		if (s == "-") break;
		long n;
		n = s.size();
		long m;
		cin >> m;
		for (long i = 0; i < m; i++){
			long hm;
			cin >> hm;
			string t;
			for (long j = 0; j < n; j++){
				if (j + hm < n) t[j] = s[j + hm];
				else t[j] = s[j - n + hm];
			}
		}
		for (long i = 0; i < n; i++){
			cout << t[i];
		}
		cout << endl;
	}
	return 0;
}

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

public class Main {
    public static void main(String[] args) {

        // ??????????????????????????????.
        java.util.Scanner sc = new java.util.Scanner(System.in);


        // ????????? (??????????????????) ???????????????. "-" ??????????????????.
        // ??´??° (?????£??????????????°) ???????????????.
        while (true) {
            String first = sc.next();
            if (first.equals("-")) { break; }
            int m = sc.nextInt();
            int h;

            // ?????£??????????????°???????????´??° (????????????????????°) ???????????????.
            // ?±±??????????????????????????????.
            // ?±±???????????¨?????????????????????????????????????????????.
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < m; i ++)  {
                sb.delete(0, first.length());
                h = sc.nextInt();
                sb.append(first.substring(h, first.length()));
                sb.append(first.substring(0, h));
            }
            System.out.println(sb.toString());
        }
    }
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'public'
    1 | public class Main {
      | ^~~~~~
Language: C++

#include <stdio.h>
#include <math.h>
#include <string.h>
#define rep(i,a,n) for(int i=a;i<n;i++)

int main(){
	char s[210],t[210]="";
	int m,h,len;
	while(1){
		scanf("%s",s);
		if(strcmp(s,"-")==0) break;
		len=strlen(s);
		scanf("%d",&m);
		rep(i,0,m){
			scanf("%d",&h);
			rep(j,0,h){
				t[j+len-h]=s[j];
			}
			rep(j,h,len){
				t[j-h]=s[j];
			}
			sprintf(s,"%s",t);
		}
		printf("%s\n",s);
	}
	return 0;
}a

Compiler output:
a.cc:27:2: error: 'a' does not name a type
   27 | }a
      |  ^
Language: C++

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

int main(){

	string str, str1, str2;
	int m;

	while(cin >> str){
		if(str == "-") break;
		cin >> m;
		int h;

		for(int i=0; i<m: i++){
			cin >> h;
			str1 = str.substr(0,h);
			str2 = str.substr(h);
			str = str2 + str1;
		}

		cout << str << endl;

	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:30: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   15 |                 for(int i=0; i<m: i++){
      |                              ^
a.cc:15:33: error: found ':' in nested-name-specifier, expected '::'
   15 |                 for(int i=0; i<m: i++){
      |                                 ^
      |                                 ::
a.cc:15:32: error: 'm' is not a class, namespace, or enumeration
   15 |                 for(int i=0; i<m: i++){
      |                                ^
a.cc:24:9: error: expected primary-expression before '}' token
   24 |         }
      |         ^
a.cc:22:37: error: expected ')' before '}' token
   22 |                 cout << str << endl;
      |                                     ^
      |                                     )
   23 | 
   24 |         }
      |         ~                            
a.cc:15:20: note: to match this '('
   15 |                 for(int i=0; i<m: i++){
      |                    ^
a.cc:24:9: error: expected primary-expression before '}' token
   24 |         }
      |         ^
Language: C++

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

int main()
{
	std string a;
	int h,m,i;
	
	while(1){
		cin >> a;
		if( a == '-')break;
		
		cin >> m;
		for( i=0; i<m; i++){
			cin >> h;
			a = a.erase(0,h) + a.substr(0,h);
		}
		cout << a << endl;
	}
	return 0;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected primary-expression before 'string'
    7 |         std string a;
      |             ^~~~~~
a.cc:11:24: error: 'a' was not declared in this scope
   11 |                 cin >> a;
      |                        ^
Language: C++

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

#define rep(i,start,n) for(int i=0 ; i<n ; i++)            //???????????????

using namespace std;

int main(){

int count_change=0,b[100]={0};                           //count_change??????????????£????????????????????????b[100]??????????????????????????????????????????????´????????????°
string member,change;                                   //member?????????????????????????????????????´????change????????£????????????????????????????´????????????°

while(1){

  cin >> member;                                      //????????????????????????????????\???
/*   if(member.size() >= 200){
     return 0;                                          //??????????????????????????????200??\????????´???????????¶??????
   }*/
   if(member == "-") break;                              // ???????????????????????????????????¶
   cin >> count_change;                                 //?????£????????????????????°?????\???
   rep(i , 0 , count_change){                              //???????????????
     cin >> b[i];                                          //?????£????????????????????°?????\???
     change = member.substr(0,b[i]);                         //???????????????????????????????????????????????\?????????????????£????????????????????°?????§???????????????change???????´?
     member += change;                                      //member????????????????????????????????£?????????
     member = member.substr(b[i],member.length([i]));                //????????????????????????????????????member???????´?

   }
cout << member << endl;                                  //??¨???

  }

return 0;

}

Compiler output:
a.cc: In lambda function:
a.cc:26:51: error: expected '{' before ')' token
   26 |      member = member.substr(b[i],member.length([i]));                //????????????????????????????????????member???????´?
      |                                                   ^
a.cc: In function 'int main()':
a.cc:26:47: error: no matching function for call to 'std::__cxx11::basic_string<char>::length(main()::<lambda()>)'
   26 |      member = member.substr(b[i],member.length([i]));                //????????????????????????????????????member???????´?
      |                                  ~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1083:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 1083 |       length() const _GLIBCXX_NOEXCEPT
      |       ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1083:7: note:   candidate expects 0 arguments, 1 provided
Language: C++

#include <iostream>
#include <string>

#define MAX_SET (1000)
#define MAX_LEN (200)
#define MAX_SHU (100)

using namespace std;

void shuffle(string str, int h[],  int m);

int main()
{
    int m;
    int size;

    string* str = new string[MAX_SET + 1];

    for (int i = 0; i < MAX_SET + 1; i++) {
         do {
             cin >> str[i];
         } while (str.length() > MAX_LEN);

         if (str[i] == "-") {
             size = i;
             break;
         }
        
         do {
	     cin >> m;
         } while (m < 0 || m > MAX_SHU);

         int* h = new int[m];

         for (int j = 0; j < m; j++) {
              do {
                  cin >> h[j];
              } while (h[j] < 0 || h[j] > str[i].length());
         }
       
         shuffle(str[i], m);

         delete[] h;
     }
 
     for (int i = 0; i < size; i++) {
          cout << str[i] << endl;
     }

     delete[] str;

     return (0);
}

void shuffle(string str, int h[], int m)
{
     for (int j = 0; j < m; j++) {
          str = substr(str.length() - h[j] - 1, str.length() - 1) + substr(0, h[j]);
     } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: request for member 'length' in 'str', which is of pointer type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} (maybe you meant to use '->' ?)
   22 |          } while (str.length() > MAX_LEN);
      |                       ^~~~~~
a.cc:41:26: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   41 |          shuffle(str[i], m);
      |                          ^
      |                          |
      |                          int
a.cc:41:17: error: too few arguments to function 'void shuffle(std::string, int*, int)'
   41 |          shuffle(str[i], m);
      |          ~~~~~~~^~~~~~~~~~~
a.cc:10:6: note: declared here
   10 | void shuffle(string str, int h[],  int m);
      |      ^~~~~~~
a.cc: In function 'void shuffle(std::string, int*, int)':
a.cc:58:17: error: 'substr' was not declared in this scope
   58 |           str = substr(str.length() - h[j] - 1, str.length() - 1) + substr(0, h[j]);
      |                 ^~~~~~
Language: C++

#include <iostream>
#include <string>

#define MAX_SET (1000)
#define MAX_LEN (200)
#define MAX_SHU (100)

using namespace std;

void shuffle(string str, int h[],  int m);

int main()
{
    int m;
    int size;

    string* str = new string[MAX_SET + 1];

    for (int i = 0; i < MAX_SET + 1; i++) {
         do {
             cin >> str[i];
         } while (str[i].length() > MAX_LEN);

         if (str[i] == "-") {
             size = i;
             break;
         }
        
         do {
	     cin >> m;
         } while (m < 0 || m > MAX_SHU);

         int* h = new int[m];

         for (int j = 0; j < m; j++) {
              do {
                  cin >> h[j];
              } while (h[j] < 0 || h[j] > str[i].length());
         }
       
         shuffle(str[i], m);

         delete[] h;
     }
 
     for (int i = 0; i < size; i++) {
          cout << str[i] << endl;
     }

     delete[] str;

     return (0);
}

void shuffle(string str, int h[], int m)
{
     for (int j = 0; j < m; j++) {
          str = substr(str.length() - h[j] - 1, str.length() - 1) + substr(0, h[j]);
     } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:26: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   41 |          shuffle(str[i], m);
      |                          ^
      |                          |
      |                          int
a.cc:41:17: error: too few arguments to function 'void shuffle(std::string, int*, int)'
   41 |          shuffle(str[i], m);
      |          ~~~~~~~^~~~~~~~~~~
a.cc:10:6: note: declared here
   10 | void shuffle(string str, int h[],  int m);
      |      ^~~~~~~
a.cc: In function 'void shuffle(std::string, int*, int)':
a.cc:58:17: error: 'substr' was not declared in this scope
   58 |           str = substr(str.length() - h[j] - 1, str.length() - 1) + substr(0, h[j]);
      |                 ^~~~~~
Language: C++

#include <iostream>
#include <string>

#define MAX_SET (1000)
#define MAX_LEN (200)
#define MAX_SHU (100)

using namespace std;

void shuffle(string str, int h[],  int m);

int main()
{
    int m;
    int size;

    string* str = new string[MAX_SET + 1];

    for (int i = 0; i < MAX_SET + 1; i++) {
         do {
             cin >> str[i];
         } while (str[i].length() > MAX_LEN);

         if (str[i] == "-") {
             size = i;
             break;
         }
        
         do {
	     cin >> m;
         } while (m < 0 || m > MAX_SHU);

         int* h = new int[m];

         for (int j = 0; j < m; j++) {
              do {
                  cin >> h[j];
              } while (h[j] < 0 || h[j] > str[i].length());
         }
       
         shuffle(str[i], h, m);

         delete[] h;
     }
 
     for (int i = 0; i < size; i++) {
          cout << str[i] << endl;
     }

     delete[] str;

     return (0);
}

void shuffle(string str, int h[], int m)
{
     for (int j = 0; j < m; j++) {
          str = substr(str.length() - h[j] - 1, str.length() - 1) + substr(0, h[j]);
     } 
}

Compiler output:
a.cc: In function 'void shuffle(std::string, int*, int)':
a.cc:58:17: error: 'substr' was not declared in this scope
   58 |           str = substr(str.length() - h[j] - 1, str.length() - 1) + substr(0, h[j]);
      |                 ^~~~~~
Language: C++

#include <iostream>
#include <string>

#define MAX_SET (1000)
#define MAX_LEN (200)
#define MAX_SHU (100)

using namespace std;

void shuffle(string* str, int h[],  int m);

int main()
{
    int m;
    int size;

    string* str = new string[MAX_SET + 1];

    for (int i = 0; i < MAX_SET + 1; i++) {
         do {
             cin >> str[i];
         } while (str[i].length() > MAX_LEN);

         if (str[i] == "-") {
             size = i;
             break;
         }
        
         do {
	     cin >> m;
         } while (m < 0 || m > MAX_SHU);

         int* h = new int[m];

         for (int j = 0; j < m; j++) {
              do {
                  cin >> h[j];
              } while (h[j] < 0 || h[j] > str[i].length());
         }
       
         shuffle(&str[i], h, m);

         delete[] h;
     }
 
     for (int i = 0; i < size; i++) {
          cout << str[i] << endl;
     }

     delete[] str;

     return (0);
}

void shuffle(string* str, int h[], int m)
{
     for (int j = 0; j < m; j++) {
          str = str.substr(h[j], str.length() - 1) + str.substr(0, h[j] - 1);
     } 
}

Compiler output:
a.cc: In function 'void shuffle(std::string*, int*, int)':
a.cc:58:21: error: request for member 'substr' in 'str', which is of pointer type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} (maybe you meant to use '->' ?)
   58 |           str = str.substr(h[j], str.length() - 1) + str.substr(0, h[j] - 1);
      |                     ^~~~~~
a.cc:58:38: error: request for member 'length' in 'str', which is of pointer type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} (maybe you meant to use '->' ?)
   58 |           str = str.substr(h[j], str.length() - 1) + str.substr(0, h[j] - 1);
      |                                      ^~~~~~
a.cc:58:58: error: request for member 'substr' in 'str', which is of pointer type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} (maybe you meant to use '->' ?)
   58 |           str = str.substr(h[j], str.length() - 1) + str.substr(0, h[j] - 1);
      |                                                          ^~~~~~
Language: C++

#include <iostream>
#include <string>

#define MAX_SET (1000)
#define MAX_LEN (200)
#define MAX_SHU (100)

using namespace std;

void shuffle(string* str, int h[], int m);

int main()
{
    int m;
    int size;

    string* str = new string[MAX_SET + 1];

    for (int i = 0; i < MAX_SET + 1; i++) {
         do {
             cin >> str[i];
         } while (str[i].length() > MAX_LEN);

         if (str[i] == "-") {
             size = i;
             break;
         }
        
         do {
	     cin >> m;
         } while (m < 0 || m > MAX_SHU);

         int* h = new int[m];

         for (int j = 0; j < m; j++) {
              do {
                  cin >> h[j];
              } while (h[j] < 0 || h[j] > str[i].length());
         }
       
         shuffle(&str[i], h, m);

         delete[] h;
     }
 
     for (int i = 0; i < size; i++) {
          cout << str[i] << endl;
     }

     delete[] str;

     return (0);
}

void shuffle(string* str, int h[], int m)
{
     for (int j = 0; j < m; j++) {
          *str = str.substr(h[j], *str.length() - 1) + *str.substr(0, h[j] - 1);
     } 
}

Compiler output:
a.cc: In function 'void shuffle(std::string*, int*, int)':
a.cc:58:22: error: request for member 'substr' in 'str', which is of pointer type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} (maybe you meant to use '->' ?)
   58 |           *str = str.substr(h[j], *str.length() - 1) + *str.substr(0, h[j] - 1);
      |                      ^~~~~~
a.cc:58:40: error: request for member 'length' in 'str', which is of pointer type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} (maybe you meant to use '->' ?)
   58 |           *str = str.substr(h[j], *str.length() - 1) + *str.substr(0, h[j] - 1);
      |                                        ^~~~~~
a.cc:58:61: error: request for member 'substr' in 'str', which is of pointer type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} (maybe you meant to use '->' ?)
   58 |           *str = str.substr(h[j], *str.length() - 1) + *str.substr(0, h[j] - 1);
      |                                                             ^~~~~~
Language: C++

#include <iostream>
#include <string>

#define MAX_SET (1000)
#define MAX_LEN (200)
#define MAX_SHU (100)

using namespace std;

void shuffle(string* str, int h[], int m);

int main()
{
    int m;
    int size;

    string* str = new string[MAX_SET + 1];

    for (int i = 0; i < MAX_SET + 1; i++) {
         do {
             cin >> str[i];
         } while (str[i].length() > MAX_LEN);

         if (str[i] == "-") {
             size = i;
             break;
         }
        
         do {
	     cin >> m;
         } while (m < 0 || m > MAX_SHU);

         int* h = new int[m];

         for (int j = 0; j < m; j++) {
              do {
                  cin >> h[j];
              } while (h[j] < 0 || h[j] > str[i].length());
         }
       
         shuffle(&str[i], h, m);

         delete[] h;
     }
 
     for (int i = 0; i < size; i++) {
          cout << str[i] << endl;
     }

     delete[] str;

     return (0);
}

void shuffle(string* str, int h[], int m)
{
     for (int j = 0; j < m; j++) {
          *str = *str.substr(h[j], *str.length() - 1) + *str.substr(0, h[j] - 1);
     } 
}

Compiler output:
a.cc: In function 'void shuffle(std::string*, int*, int)':
a.cc:58:23: error: request for member 'substr' in 'str', which is of pointer type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} (maybe you meant to use '->' ?)
   58 |           *str = *str.substr(h[j], *str.length() - 1) + *str.substr(0, h[j] - 1);
      |                       ^~~~~~
a.cc:58:41: error: request for member 'length' in 'str', which is of pointer type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} (maybe you meant to use '->' ?)
   58 |           *str = *str.substr(h[j], *str.length() - 1) + *str.substr(0, h[j] - 1);
      |                                         ^~~~~~
a.cc:58:62: error: request for member 'substr' in 'str', which is of pointer type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} (maybe you meant to use '->' ?)
   58 |           *str = *str.substr(h[j], *str.length() - 1) + *str.substr(0, h[j] - 1);
      |                                                              ^~~~~~
Language: C++

#include <iostream>
#include <string>


#define MAX_LEN (200)
#define MAX_SHU (100)

using namespace std;

void shuffle(string* str, int h[], int m);

int main()
{
    int m;
    int size;
  
    while (1) {
           string str;
         
           do {
               cin >> str;
           } while (str.length() > MAX_LEN);
                        
           if (str == "-") {
               break;
           } else {
               do {
                   cin >> m;
               } while (m > MAX_SHU);

               int* h = new int[m];

               for (int i = 0; i < m; i++) {
                    cin >> h[i];
               }

               shuffle(str, h, m);                  
           }

           cout << str << endl;
 
           delete[] str;
    }

    return (0);
}

void shuffle(string str, int h, int m)
{
     for (int j = 0; j < m; j++) {
          *str = (*str).substr(h, (*str).length() - 1) + (*str).substr(0, h - 1);
     } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:24: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::string*' {aka 'std::__cxx11::basic_string<char>*'}
   37 |                shuffle(str, h, m);
      |                        ^~~
      |                        |
      |                        std::string {aka std::__cxx11::basic_string<char>}
a.cc:10:22: note:   initializing argument 1 of 'void shuffle(std::string*, int*, int)'
   10 | void shuffle(string* str, int h[], int m);
      |              ~~~~~~~~^~~
a.cc:42:21: error: type 'std::string' {aka 'class std::__cxx11::basic_string<char>'} argument given to 'delete', expected pointer
   42 |            delete[] str;
      |                     ^~~
a.cc: In function 'void shuffle(std::string, int, int)':
a.cc:51:11: error: no match for 'operator*' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   51 |           *str = (*str).substr(h, (*str).length() - 1) + (*str).substr(0, h - 1);
      |           ^~~~
a.cc:51:19: error: no match for 'operator*' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   51 |           *str = (*str).substr(h, (*str).length() - 1) + (*str).substr(0, h - 1);
      |                   ^~~~
a.cc:51:36: error: no match for 'operator*' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   51 |           *str = (*str).substr(h, (*str).length() - 1) + (*str).substr(0, h - 1);
      |                                    ^~~~
a.cc:51:59: error: no match for 'operator*' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   51 |           *str = (*str).substr(h, (*str).length() - 1) + (*str).substr(0, h - 1);
      |                                                           ^~~~
Language: C++

#include <iostream>
#include <string>

#define MAX_LEN (200)
#define MAX_SHU (100)

using namespace std;

void shuffle(string* str, int h[], int m);

int main()
{
    int m;
    int size;
  
    while (1) {
           string str;
         
           do {
               cin >> str;
           } while (str.length() > MAX_LEN);
                        
           if (str == "-") {
               break;
           } else {
               do {
                   cin >> m;
               } while (m > MAX_SHU);

               int* h = new int[m];

               for (int i = 0; i < m; i++) {
                    cin >> h[i];
               }

               shuffle(&str, h, m);                  
           }

           cout << str << endl;
 
           delete[] str;
    }

    return (0);
}

void shuffle(string &str, int h, int m)
{
     for (int j = 0; j < m; j++) {
          str = str.substr(h, str.length() - 1) + str.substr(0, h - 1);
     } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:21: error: type 'std::string' {aka 'class std::__cxx11::basic_string<char>'} argument given to 'delete', expected pointer
   41 |            delete[] str;
      |                     ^~~
Language: C++

#include <iostream>
#include <string>

#define MAX_LEN (200)
#define MAX_SHU (100)

using namespace std;

void shuffle(string* str, int h[], int m);

int main()
{
    int m;
    int size;
  
    while (1) {
           string str;
         
           do {
               cin >> str;
           } while (str.length() > MAX_LEN);
                        
           if (str == "-") {
               break;
           } else {
               do {
                   cin >> m;
               } while (m > MAX_SHU);

               int* h = new int[m];

               for (int i = 0; i < m; i++) {
                    cin >> h[i];
               }

               shuffle(str, h, m);                  
           }

           cout << str << endl;
    }

    return (0);
}

void shuffle(string &str, int h, int m)
{
     for (int j = 0; j < m; j++) {
          str = str.substr(h, str.length() - 1) + str.substr(0, h - 1);
     } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:24: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::string*' {aka 'std::__cxx11::basic_string<char>*'}
   36 |                shuffle(str, h, m);
      |                        ^~~
      |                        |
      |                        std::string {aka std::__cxx11::basic_string<char>}
a.cc:9:22: note:   initializing argument 1 of 'void shuffle(std::string*, int*, int)'
    9 | void shuffle(string* str, int h[], int m);
      |              ~~~~~~~~^~~
Language: C++

#include <iostream>
#include <string>

#define MAX_LEN (200)
#define MAX_SHU (100)

using namespace std;

void shuffle(string& str, int h[], int m);

int main()
{
    int m;
    int size;
  
    while (1) {
           string str;
         
           do {
               cin >> str;
           } while (str.length() > MAX_LEN);
                        
           if (str == "-") {
               break;
           } else {
               do {
                   cin >> m;
               } while (m > MAX_SHU);

               int* h = new int[m];

               for (int i = 0; i < m; i++) {
                    cin >> h[i];
               }

               shuffle(str, h, m);                  
           }

           cout << str << endl;
    }

    return (0);
}

void shuffle(string& str, int h, int m)
{
     for (int j = 0; j < m; j++) {
          str = str.substr(h, str.length() - 1) + str.substr(0, h - 1);
     } 
}

Compiler output:
/usr/bin/ld: /tmp/ccIbb9CS.o: in function `main':
a.cc:(.text+0xfe): undefined reference to `shuffle(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, int*, int)'
collect2: error: ld returned 1 exit status
Language: C++

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

int main(){
     int m,h;
     string left,right,a;
     cin>>m;
     while(1){
          cin>>a;
          if(a=="-") break;
          for(int i=0;i<m;i++){
               cin>>h;
               left=str.substr(0,h);
               right=str.substr(h);
               a=right+left;
          }
          cout<<a<<endl;
      }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: 'str' was not declared in this scope; did you mean 'std'?
   14 |                left=str.substr(0,h);
      |                     ^~~
      |                     std
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
	int i,m,h;
	string str;
	while(1){
		cin >> str;
		if(str=="-") break;
		cin >> m;
		for(i=0;i<m;i++){
			cin >> h;
			string right = str.substr(0,h);
			string left = str.substr(h);
			str = left + right;
		}
		cout << str << end1;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:32: error: 'end1' was not declared in this scope
   19 |                 cout << str << end1;
      |                                ^~~~
Language: C++

//============================================================================
// Name        : AOJ.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

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

int main() {
	char chr;
	int m,h;

	while(1){
		cin>>chr;
		if (chr=="-")break;
		cin>>m;
		for (int i=0;i<m;i++){
			cin>>h;
			chr=shuffle(chr,h);
		}
		cout<<chr;

	}




	cout<<chr<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |                 if (chr=="-")break;
      |                     ~~~^~~~~
a.cc:25:29: error: 'shuffle' was not declared in this scope
   25 |                         chr=shuffle(chr,h);
      |                             ^~~~~~~
Language: C++

//============================================================================
// Name        : AOJ.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

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

int main() {
	string card;
	int m,h;

	while(1){
		cin>>card;
		if(card=="-")break;
		cin>>m;
		for(int i=0;i<m;i++){
			cin>>h;
			card=shuffle(card,h);
		}
		cout<<card<<endl;
	}



	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:30: error: 'shuffle' was not declared in this scope
   25 |                         card=shuffle(card,h);
      |                              ^~~~~~~
Language: C++

S = raw_input()
while(S!="-"):
    m = int(raw_input())
    for i in range(m):
        h = int(raw_input())
        S = S[h:] + S[0:h]
    print S
    S = raw_input()

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


#include <iostream>
#include <string>

using namespace std;

int main()
{
    string str;
    while(getline(cin, str))
    {
        if(str = '-'){ break; }

        string buf;
        getline(cin, buf);
        int n = stoi(buf);
        for(int i = 0; i < n; i++)
        {
            getline(cin, buf);
            int x = stoi(buf);
            str = str.substr(x) + str.substr(0,x);
        }
        cout << str << endl;

    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: could not convert 'str.std::__cxx11::basic_string<char>::operator=(45)' from 'std::__cxx11::basic_string<char>' to 'bool'
   12 |         if(str = '-'){ break; }
      |            ~~~~^~~~~
      |                |
      |                std::__cxx11::basic_string<char>
Language: C++


#include <iostream>
#include <string>

using namespace std;

int main()
{

    int count = 0;
    string str;
    while(getline(cin, str))
    {
        if(str.c_str() == '-'){ break; }

        string buf;
        getline(cin, buf);
        int n = stoi(buf);
        for(int i = 0; i < n; i++)
        {
            getline(cin, buf);
            int x = stoi(buf);
            str = str.substr(x) + str.substr(0,x);
        }
        cout << str << endl;

    }

    return 0;
}

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

#include <stdio.h>

int main(){
    char cards[200];
    char newCards[200];
    int m, cardsLen;
    //int h[100];
    int h;

    while(true) {
        scanf("%s",&cards);
        if(cards == "-") break;

        cardsLen = 0;
        while(cards[cardsLen] != '\0') cardsLen++;

        scanf("%d",&m);
        for(int i=0;i<m;i++){
            //scanf("%d",&h[i]);
            scanf("%d",&h);

            for(j=0;j<cardsLen;j++){
                newCards[j] = cards[(j+h) % cardsLen];
            }
            
            for(j=0;j<cardsLen;j++){
                cards[j] = newCards[j];
            }
        }

        printf("%s\n", cards);
        
    }

    return 0;
}

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

#include<iostream>
#include<string>
using namespace std;
int main(){
	string L,R,all;
	int m, h[100],j = 0;
	while (1){
		j++;
		cin >> h[j];
		cin >> m;
		for (int i = 0; i < m; i++){
			    L = all.substr(h[j] + 1, all.size);
				R = all.substr(0, h[j]);
			
		}
		if (h[m] == '-')break;
	}
	cout << L + R << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:58: error: invalid use of non-static 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]'
   12 |                             L = all.substr(h[j] + 1, all.size);
      |                                                      ~~~~^~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1076:7: note: declared here
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
Language: C++

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

int main() {
    std::ios::sync_with_stdio(false);
    string cards, subcards;
    int n_shuffles, length;

    while(std::cin) {
        std::cin >> cards;
        if (cards == "-") break;

        std::cin >> n_shuffles;
        for (int i = 0; i < n_shuffles; i++) {
            std::cin >> length;
            subcards = cards.substr(0, length);
            cards = cards.substr(length) + subcards;
        }
        std::cout << cards << "\n";
    }

    return 0;
}
Contact GitHub API Training Shop Blog About

Compiler output:
a.cc:25:1: error: 'Contact' does not name a type
   25 | Contact GitHub API Training Shop Blog About
      | ^~~~~~~
Language: C++

#include <iostream>
#include <string>
using name space std;
using std::string;

int main() {
    std::ios::sync_with_stdio(false);
    string cards, subcards;
    int n_shuffles, length;

    while(std::cin) {
        std::cin >> cards;
        if (cards == "-") break;

        std::cin >> n_shuffles;
        for (int i = 0; i < n_shuffles; i++) {
            std::cin >> length;
            subcards = cards.substr(0, length);
            cards = cards.substr(length) + subcards;
        }
        std::cout << cards << "\n";
    }

    return 0;
}
Contact GitHub API Training Shop Blog About

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'name'
    3 | using name space std;
      |       ^~~~
a.cc:26:1: error: 'Contact' does not name a type
   26 | Contact GitHub API Training Shop Blog About
      | ^~~~~~~
Language: C++

#include <iostream>
#include <string>
using name space std;


int main() {
    std::ios::sync_with_stdio(false);
    string cards, subcards;
    int n_shuffles, length;

    while(std::cin) {
        std::cin >> cards;
        if (cards == "-") break;

        std::cin >> n_shuffles;
        for (int i = 0; i < n_shuffles; i++) {
            std::cin >> length;
            subcards = cards.substr(0, length);
            cards = cards.substr(length) + subcards;
        }
        std::cout << cards << "\n";
    }

    return 0;
}
Contact GitHub API Training Shop Blog About

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'name'
    3 | using name space std;
      |       ^~~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'string' was not declared in this scope
    8 |     string cards, subcards;
      |     ^~~~~~
a.cc:8:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:12:21: error: 'cards' was not declared in this scope
   12 |         std::cin >> cards;
      |                     ^~~~~
a.cc:18:13: error: 'subcards' was not declared in this scope
   18 |             subcards = cards.substr(0, length);
      |             ^~~~~~~~
a.cc: At global scope:
a.cc:26:1: error: 'Contact' does not name a type
   26 | Contact GitHub API Training Shop Blog About
      | ^~~~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
 string L,R,all;

 int m,h = 0,p;


 while (1){

 	cin >> all;

 	cin >> m ;

 	if (all == "-")break;

 	
 
 	for (int i = 0 ; i < m ; i++ ){

 		cin >> h ;
 		p == h + 1;
 		q == all.size();

 		string L = all.substr(0,h);
 		string R = all.substr(p,q);
 		string all =  L + R;
 	}

 	 cout << all << endl;

 }


 return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 'q' was not declared in this scope
   27 |                 q == all.size();
      |                 ^
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
	int h[100],m;
	string all, l, r;
	while (1){
		cin >>all>> m;
		if (all == "-")break;
		for (int i = 0; i < m; i++){
			cin >> h[m];
			l = all.substr(0, h[m]);
			r = all.substr(h[m] + 1, all.size);
			all = r + l;
		}
		cout << all << endl;
		
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:54: error: invalid use of non-static 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]'
   13 |                         r = all.substr(h[m] + 1, all.size);
      |                                                  ~~~~^~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1076:7: note: declared here
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
Language: C++

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

int main(void)
{	
	while (1) {
		char card[201] = "\0";
		cin >> card;
		
		if (card[0] == '-' && card[1] == '\0') break;
		
		int cnum = strlen(card);
		int m;
		cin >> m;
		for (int i = 0; i < m; i++) {
			int h;
			cin >> h;
			
			char temp[201] = "\0";
			strcpy(temp, card, h);
			for (int j = 0; j < cnum - h; j++) {
				card[j] = card[h + j];
			}
			strcpy(&card[cnum], temp, h);
		}
		
		cout << card << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:31: error: too many arguments to function 'char* strcpy(char*, const char*)'
   22 |                         strcpy(temp, card, h);
      |                         ~~~~~~^~~~~~~~~~~~~~~
In file included from a.cc:2:
/usr/include/string.h:141:14: note: declared here
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |              ^~~~~~
a.cc:26:31: error: too many arguments to function 'char* strcpy(char*, const char*)'
   26 |                         strcpy(&card[cnum], temp, h);
      |                         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/string.h:141:14: note: declared here
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |              ^~~~~~
Language: C++

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

int main(void)
{	
	while (1) {
		char card[201] = "\0";
		cin >> card;
		
		if (card[0] == '-' && card[1] == '\0') break;
		
		int cnum = strlen(card);
		int m;
		cin >> m;
		for (int i = 0; i < m; i++) {
			int h;
			cin >> h;
			
			char temp[201] = "\0";
			strcpy(temp, card, h);
			for (int j = 0; j < cnum - h; j++) {
				card[j] = card[h + j];
			}
			strnacpy(&card[cnum], temp, h);
		}
		
		cout << card << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:31: error: too many arguments to function 'char* strcpy(char*, const char*)'
   22 |                         strcpy(temp, card, h);
      |                         ~~~~~~^~~~~~~~~~~~~~~
In file included from a.cc:2:
/usr/include/string.h:141:14: note: declared here
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |              ^~~~~~
a.cc:26:25: error: 'strnacpy' was not declared in this scope; did you mean 'strncpy'?
   26 |                         strnacpy(&card[cnum], temp, h);
      |                         ^~~~~~~~
      |                         strncpy
Language: C++

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

int main(void)
{	
	while (1) {
		char card[201] = "\0";
		cin >> card;
		
		if (card[0] == '-' && card[1] == '\0') break;
		
		int cnum = strlen(card);
		int m;
		cin >> m;
		for (int i = 0; i < m; i++) {
			int h;
			cin >> h;
			
			char temp[201] = "\0";
			strncpy(temp, card, h);
			for (int j = 0; j < cnum - h; j++) {
				card[j] = card[h + j];
			}
			strnacpy(&card[cnum], temp, h);
		}
		
		cout << card << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: 'strnacpy' was not declared in this scope; did you mean 'strncpy'?
   26 |                         strnacpy(&card[cnum], temp, h);
      |                         ^~~~~~~~
      |                         strncpy