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:28
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
string input;
getline(cin, input);
stringstream ss(input);
int value = 0;
int output = 0;
int all[5];
int count = 0;
while (ss >> value)
{
count++;
if (count > 5)
{
cout << "Wrong format, please make sure there are exactly 5 numbers.";
return 0;
}
all[count - 1] = value;
}
if (count < 5)
{
cout << "Wrong format, please make sure there are exactly 5 numbers.";
return 0;
}
for (int i = count - 1; i >= 0; i--)
{
cout << all[i];
if (i != 0)
{
cout << " ";
}
}
}