#include <stdio.h>
#include <math.h>
int reverse(int num) {
int inv = 0;
int dig = 0;
for (int i = 2; i >= 0; i--) {
dig
= num
/ (int)pow(10.0, (double)i
); //infelizmente C não tem uma função de potência para inteiro num
-= dig
* (int)pow(10.0, (double)i
); inv
+= dig
* (int)pow(10.0, (double)(2 - i
)); }
return inv;
}
int main(void) {
}
//https://pt.stackoverflow.com/q/37031/101
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+CgppbnQgcmV2ZXJzZShpbnQgbnVtKSB7CiAgICBpbnQgaW52ID0gMDsKICAgIGludCBkaWcgPSAwOwogICAgZm9yIChpbnQgaSA9IDI7IGkgPj0gMDsgaS0tKSB7CiAgICAgICAgZGlnID0gbnVtIC8gKGludClwb3coMTAuMCwgKGRvdWJsZSlpKTsgLy9pbmZlbGl6bWVudGUgQyBuw6NvIHRlbSB1bWEgZnVuw6fDo28gZGUgcG90w6puY2lhIHBhcmEgaW50ZWlybwogICAgICAgIG51bSAtPSBkaWcgKiAoaW50KXBvdygxMC4wLCAoZG91YmxlKWkpOwogICAgICAgIGludiArPSBkaWcgKiAoaW50KXBvdygxMC4wLCAoZG91YmxlKSgyIC0gaSkpOwogICAgfQogICAgcmV0dXJuIGludjsKfQoKaW50IG1haW4odm9pZCkgewoJcHJpbnRmKCIlZCIsIHJldmVyc2UoMTIzKSk7Cn0KCi8vaHR0cHM6Ly9wdC5zdGFja292ZXJmbG93LmNvbS9xLzM3MDMxLzEwMQ==