Untitled

 avatar
unknown
plain_text
2 years ago
403 B
3
Indexable
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int perevorot(int chislo) {
	int h = 1;
	int tmp = chislo;
	while (chislo >= 10) {
		chislo /= 10;
		h += 1;
	}
	chislo = tmp;
	int k = 0;
	for (int i = 0; i < h; i++){
		k += (chislo % 10) * pow(10, h-1 - i);
		chislo /= 10;
	}
	return k;
}

int main() {
	int h;
	cin >> h;
	cout << perevorot(h);
}
Editor is loading...