Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main() {
- int N = 0;
- printf("Enter N = ");
- if(scanf("%d", &N) != 1) // Это ввод числа N с клавиатуры и проверка на то, введено-ли было число верно
- { // Если было успешно введено одно число, то программа продолжает работу, иначе Ошибка и выход из программы
- printf("Error.\n");
- return 0;
- }
- if(N < 0 || N > 200000000) // По условию число натуральное
- {
- printf("Error.\n");
- return 0;
- }
- int V = N%10;
- N = N/10;
- while(N > 0)
- {
- V = V*10 + N%10;
- N = N/10;
- }
- printf("V = %d\n", V);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement