#include <stdlib.h>
#include <iostream>
using namespace std;
double square(double x) {
double aux = 0;
for (int i = 0; i < x; i++) {
aux += x;
}
return aux;
}
int main() {
double x;
cout << "Digite um numero:\n";
cin >> x;
cout << "O numero " << x << " elevado ao quadrado eh: " << square(x) << "\n";
}
I2luY2x1ZGUgPHN0ZGxpYi5oPgojaW5jbHVkZSA8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpkb3VibGUgc3F1YXJlKGRvdWJsZSB4KSB7CiAgICBkb3VibGUgYXV4ID0gMDsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgeDsgaSsrKSB7CiAgICAgICAgYXV4ICs9IHg7CiAgICB9CiAgICByZXR1cm4gYXV4Owp9CmludCBtYWluKCkgewogICAgZG91YmxlIHg7CiAgICBjb3V0IDw8ICJEaWdpdGUgdW0gbnVtZXJvOlxuIjsKICAgIGNpbiA+PiB4OwogICAgY291dCA8PCAiTyBudW1lcm8gIiA8PCB4IDw8ICIgZWxldmFkbyBhbyBxdWFkcmFkbyBlaDogIiA8PCBzcXVhcmUoeCkgPDwgIlxuIjsKfQoK