문제
URL : https://codeup.kr/problemsetsol.php?psid=23
소스코드
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int n, result;
cin >> n;
if (n < 10000 && n > 99999)
{
cout << "Input error";
return -1;
}
for (int i = 1; i <= 5; i++)
{
result = n / (100000 / pow(10, i));
n = n % (int)(100000 / pow(10, i));
cout << "[" << (result * (100000 / pow(10, i))) << "]" << endl;
}
return 0;
}