#include <stdio.h>
#include <math.h>
int main() {
char operacao;
printf("Escolha a opecaracao que deseja realizar: "); switch (operacao) {
case '+': {
int n1, n2;
printf("\n%d + %d = %d", n1
, n2
, n1
+ n2
); break;
} case '-': {
int n1, n2;
printf("\n %d - %d = %d", n1
, n2
, n1
- n2
); break;
} case '*': {
int n1, n2;
printf("\n %d X %d = %d", n1
, n2
, n1
* n2
); break;
} case '/': {
int n1, n2;
printf("\n %d / %d = %.2f", n1
, n2
, (float)n1
/ n2
); break;
}
}
}
//https://pt.stackoverflow.com/q/332677/101
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxtYXRoLmg+CgppbnQgbWFpbigpIHsKICAgIGNoYXIgb3BlcmFjYW87CiAgICBwcmludGYoIkVzY29saGEgYSBvcGVjYXJhY2FvIHF1ZSBkZXNlamEgcmVhbGl6YXI6ICIpOyAKICAgIHNjYW5mKCIlYyIsICZvcGVyYWNhbyk7CiAgICBzd2l0Y2ggKG9wZXJhY2FvKSB7ICAgICAgIAogICAgY2FzZSAnKyc6IHsKICAgICAgICBpbnQgbjEsIG4yOwogICAgICAgIHByaW50ZigiXG5JbnNpcmEgTjE6ICIpOyBzY2FuZigiJWQiLCAmbjEpOwogICAgICAgIHByaW50ZigiXG5JbnNpcmEgTjI6ICIpOyBzY2FuZigiJWQiLCAmbjIpOwogICAgICAgIHByaW50ZigiXG4lZCArICVkID0gJWQiLCBuMSwgbjIsIG4xICsgbjIpOwogICAgYnJlYWs7CiAgICB9IGNhc2UgJy0nOiB7CiAgICAgICAgaW50IG4xLCBuMjsKICAgICAgICBwcmludGYoIlxuIEluc2lyYSBOMTogIik7IHNjYW5mKCIlZCIsICZuMSk7CiAgICAgICAgcHJpbnRmKCJcbiBJbnNpcmEgTjI6ICIpOyBzY2FuZigiJWQiLCAmbjIpOwogICAgICAgIHByaW50ZigiXG4gJWQgLSAlZCA9ICVkIiwgbjEsIG4yLCBuMSAtIG4yKTsKICAgIGJyZWFrOwogICAgfSBj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