Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - In C++, an integer is decomposed into numbers one by one.
In C++, an integer is decomposed into numbers one by one.
# include & ltiostream & gt

Use namespace std

int main()

{

int n,i=0,j;

int a[ 10];

Cout & lt& lt "Please enter an integer"

CIN & gt; & gtn;

while(n & gt; 0)

{

a[I]= n % 10;

n = n/ 10;

i++;

}

for(j = I- 1; j & gt=0; j -)

cout & lt& lta[j]& lt; & lt\ t ';

cout & lt& ltendl

Returns 0;

}