//Generic Digits Seperator in C++
//Output: Only 1st line is Entered by User.
#include <iostream>
using namespace std;
int main()
{
int x;
cin >> x;
int a[50];
int i = 0;
while (x != 0)
{
a[i] = x%10;
x /= 10;
i++;
}
i--;
int j = 0;
for (; i>=0; i--,j++)
{
cout << j <<". " << a[i] << endl;
}
return 0;
}
No comments:
Post a Comment