Description
Give a number not more than 5 bits, ask 1, find it is a few digits 2, respectively output each digit 3, in reverse order the output of the figures, such as the original number 321, should output 123
Input
A number that is not greater than 5 digits
Output
The first row of three lines the second line is separated by a space of each number, note that the last number is not a space after the third line output this number in reverse order
Sample Input
12345
Sample Output
51 2 3) 4 554321
HINT
Hamlet: Numbers or characters? This is a problem!
Code:
/* *copyright (c) 2014, *all rights reserved, School of computer and Control engineering, Yantai University. * File name: . cpp * by: Lenkidong * Completion date: March 29, 2014 * Version number: v1.0 */ #include <iostream>using namespace Std;int Main () { int a[5],n,i=0; cin>>n; while (n/10>0) { a[i]=n%10; N=N/10; i+=1; } A[i]=n; cout<<i+1<<endl; n=i; I=n; while (i>0) { cout<<a[i]<< ""; i--; } cout<<a[i]<<endl; i=0; while (i<n+1) { cout<<a[i]; i++; } return 0;}
The treatment of a multi-digit number of the Smoke Big ACM rookie Race