Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
403 B
0
Indexable
Never
#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);
}