Submission

Status:

---------

Subtask/Task Score:

0/100

Score: 0

User: KanemiyaKana

Problemset: บวกเลขฐาน

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-02 16:38:41

#include <iostream>
#include <string>
#include <sstream>

using namespace std;

int main ()
{
    int output = 0;
    int count = 0;
    int value = 0;
    int all[10];
    string input;
    getline(cin, input);
    stringstream ss(input);
    while (ss >> value)
    {
        count++;

        if (count > 10)
        {
            cout << "Wrong format, please make sure there are exactly 10 numbers on each line.";
            return 0;
        }
        all[count - 1] = value; 
    }
    if (count < 10)
    {
        cout << "Wrong format, please make sure there are exactly 10 numbers on each line.";
        return 0;
    }

    for (int i = 0; i < 10; i++)
    {
        if (all[i] > 0)
        {
            if (40 % all[i] == 0)
            {
                output++;
            }
        }
    }
    cout << output;
}