求助

P1320 压缩技术(续集版)

fnfyu @ 2023-09-30 14:09:18

#include<stdio.h>
#include<string.h>
int main()
{
    char arr[201][201] = {0},ch=0;
    int len,i=0,count=0,j;
    while (gets(arr[i]) != NULL) i++;
    len = strlen(arr[0]);
    printf("%d ", len);
    for (i = 0; i < len; i++)
    {
        for (j = 0; j < len; j++)
        {
            if (arr[i][j] == '0')
            {
                if (ch == '1') {
                    printf("%d ", count);
                    count = 0;
                }
                ch = arr[i][j];
                count++;
            }
            if (arr[i][j] == '1')
            {
                if (ch == '0') {
                    printf("%d ", count);
                    count = 0;
                }
                ch = arr[i][j];
                count++;
            }
        }
    }
    if (count != 0) printf("%d", count);
return 0;
}

大佬们好 Orz 这个代码在我的VS上就能跑 为什么还不能AC


|