zju2478编码Encoding

来源:互联网 发布:icon在线转换软件 编辑:程序博客网 时间:2024/06/10 06:08

几乎和2886没差别,犯得错也一模一样,唉~

用时:0ms

#include
#define MAX 101
//ok~
int main()
{
    freopen("2478.txt","r",stdin);
    freopen("output.txt","w",stdout);
    int n,i,j,k,count;
    char s[MAX],c;
    scanf("%d/n",&n);
    for(i=0;i    {
       count=1;
       gets(s);
       c=s[0];
       for(j=1;;j++)
        {
          if(c!=s[j])
          {
            if(count!=1)
            printf("%d%c",count,c);
            else
            printf("%c",c);
            if(s[j]=='/0')
            break;
            c=s[j];
            count=1;
          }     
          else
          {
             count++;
          }   
        }
        putchar('/n');
    }
    return 0;
}

原创粉丝点击