2034 整数的个数

#include<bits/stdc++.h>
#define f(i,s,e) for(int i = s; i <= e; i++)
#define ll long long
using namespace std;
const int N = 1e3+10,inf = 0x3f3f3f3f;

int main()
{
    int n,sum1 = 0,sum5 = 0,sum10 = 0; 
    cin >> n;
    for(int i = 1; i <= n; i++) //循环n次
    {
        int x; cin >> x; //每次循环都输入一个数字x
        if(x == 1) sum1++; //1出现 
        if(x == 5) sum5++; //5出现
        if(x == 10) sum10++; //10出现    
    } 
    cout << sum1 << endl;
    cout << sum5 << endl;
    cout << sum10 << endl;
    return 0;
}

 

posted @ 2024-06-28 17:55  CRt0729  阅读(6)  评论(0编辑  收藏  举报