數字翻轉

 avatar
user_3763047219
c_cpp
2 years ago
245 B
3
Indexable
Never
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include<stdbool.h>
int main()
{
	int num1, num2 = 0 ;
	scanf("%d", &num1);
	for (int i = 0;i < 5;i++) {
		num2 = num2 * 10 + num1 % 10;
		num1 = num1 / 10;
	}
	printf("%d", num2);
}