33 lines
525 B
C
33 lines
525 B
C
|
#include <stdio.h>
|
||
|
|
||
|
// Function prototypes
|
||
|
void swap(int *a, int *b);
|
||
|
|
||
|
int main(void) {
|
||
|
// Initialize variables
|
||
|
int n;
|
||
|
int length = 0;
|
||
|
int nums[10];
|
||
|
|
||
|
// Get input
|
||
|
scanf("%d", &n);
|
||
|
|
||
|
// Tabulate nums[]
|
||
|
while (n > 0) {
|
||
|
nums[length] = n % 10;
|
||
|
n /= 10;
|
||
|
length++;
|
||
|
}
|
||
|
|
||
|
// See if anything is wrong
|
||
|
if (nums[0] == 0) {
|
||
|
printf("The number cannot be changed.\n");
|
||
|
} else { // Print answer
|
||
|
for (int i = 0; i < length; i++) {
|
||
|
printf("%i", nums[i]);
|
||
|
}
|
||
|
printf("\n");
|
||
|
}
|
||
|
return 0;
|
||
|
}
|