/* Авторское решение к областной олимпиаде по информатике
16 февраля 2002 г. Запорожье.
(с) Ильяшенко Матвей 2002 г.
*/
#include <stdio.h>
#include <string.h>
char str[16384],res[16384],tmp[100];
void main()
{ int i,N,base,ntx,len;
scanf("%d",&N);
scanf("%s",str);
for(i=0;i<N;i++)
{ len=strlen(str);
ntx=0;
res[0]=0;
for(base=0;base<len;base=ntx)
{ while(str[ntx]==str[base]) ntx++;
sprintf(tmp,"%d%c",ntx-base,str[base]);
strcat(res,tmp);
}
strcpy(str,res);
}
printf("%s\n",str);
}
|
Комментарии
|
Реклама:
Разработано в студии "Webous" — о проекте — сайта карта —Реклама: