帮帮

P1320 压缩技术(续集版)

zhenghaoHoney @ 2024-09-25 19:35:18


#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>

using namespace std;

int  a,b=0,c,c2,n,a2[205],m=1;
int main(){ 
    while(cin>>a)
    {
        n++;
        if(a==b)
        {
            c++;
        }
        else
        {
            a2[m]==c;
            c2++;
            c==0;
        }
    }
    a2[0]=sqrt(n);
    for(int i=0;i<sqrt(0);i++)
    {
        cout<<a2[i];
    }
    return 0;
}

by L_V_ @ 2024-09-25 20:05:55

22行是“c=0”而不是c==0,第20行也是

数组a和变量a重名了,26行要改成“for(int i=0;i<sqrt(n);i++)”

在输出a2_i前还要输出sqrt(n)


by L_V_ @ 2024-09-25 20:07:52

你应该刚入谷不久吧


by L_V_ @ 2024-09-25 20:08:08

@zhenghaoHoney


by zhenghaoHoney @ 2024-09-25 20:19:47

@LV


by zhenghaoHoney @ 2024-09-25 20:20:22

@LV 蟹蟹


by L_V_ @ 2024-09-25 20:21:22

@zhenghaoHoney 不用谢


|