不会的请进

凌愉晴  •  27天前


输入测试数据后记得按ctrl加z

#include <bits/stdc++.h>
using namespace std;
int b[20+1];
int i,temp,sum;
int main() {
    while (scanf("%d",&temp)==1){
        b[temp]++;
        ++sum;
    }
    cout<<sum<<endl;
    for (i=0;i<=20; i++)
    printf("%d ",b[i]);
    return 0;
}

Comments: