#include "iostream"
using namespace std;
#define MAX 10
#define LEN 50
char strraw[MAX*2+1];
int a[MAX][2];
char str[MAX][LEN];
int count = 0;
int strcount = 0;
int getsplitarr(FILE* fs);
int getstrarr(FILE* fs);
int showstrarr();
static void convert(const char* array);
static void showlog(const int arr[][2],int len,int wei);
int main()
{
getsplitarr(stdin);
convert(strraw);
//showlog(a,MAX,2);
getstrarr(stdin);
showstrarr();
return 0;
}
int getsplitarr(FILE* fs)
{
if (fs == NULL)
{
return -1;
}
fgets(strraw,MAX*LEN,fs);
return 0;
}
int getstrarr(FILE* fs)
{
char c = 'a';
if (fs == NULL)
{
return -1;
}
while (fgets(str[strcount],LEN,fs) != NULL)
{
// fgets(str[strcount],LEN,fs);
// c = getchar();
if (str[strcount][0] == 10)
{
break;
}
strcount ++;
}
return 0;
}
int showstrarr()
{
int len = 0;
for (int i =0;i<strcount;i++)
{
len = strlen(str[i]);
cout<<"before converse:"<<str[i]<<endl;
cout<<"after converse:";
for (int j=0 ;j <count; j++)
{
if (len <a[j][0])
{
break;
}
else if ((len >= a[j][0]) && (len <= a[j][1]))
{
for (int k= a[j][0] ;k<= len-1; k++)
cout<<str[i][k];
}
else
{
for (int k= a[j][0] ;k<= a[j][1]; k++)
cout<<str[i][k];
}
}
cout<<endl;
}
return 0;
}
static void convert(const char* array)
{
int size = strlen(array);
for (int i =0;i<size;i++)
{
if (array[i] == 45 || array[i] == 10) //结束符号 注:45 :-1;10:回车符
{
break;
}
if (array[i] == 32)//32空格键
{
continue;
}
if (a[count][0] == 0)
{
a[count][0] = array[i] - '0';
}
else if (a[count][1] == 0)
{
a[count][1] = array[i] - '0';
}
if ((a[count][0] * a[count][1]) >0)
{
count =count +1;
}
}
return;
}
static void showlog(const int arr[][2],int len,int wei)
{
for (int i=0;i<len;i++)
{
for (int j=0;j<wei;j++)
{
cout<<arr[i][j];
}
cout<<endl;
}
return ;
}