#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
int main()
{
std::string nome, menu;
float saldo, valor;
std::cout << "Digite seu nome: \n";
std::cin >> nome;
std::cout << "Digite o saldo: \n";
std::cin >> saldo;
std::cout << "Digite o valor: \n";
std::cin >> valor;
std::cout << "Digite uma das opcoes (saldo/deposito/retirada):\n";
std::cin >> menu;
if (menu == "deposito") {
saldo = saldo + valor;
printf("O saldo mais o valor depositado e igual a: %.2f\n", saldo);
}else if (menu == "retirada") {
if(valor <= saldo){
saldo -= valor;
printf("O saldo menos o valor depositado e igual a: %.2f\n", saldo);
}else {
printf("Nao foi possivel fazer a retirada, pois o valor que voce retirou e maior que o saldo da conta! \n");
}
}else if (menu == "saldo") {
printf("O saldo e igual a: %.2f\n", saldo);
}else {
printf("Erro");
}
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPG1hdGguaD4KI2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IG1haW4oKQp7CiAgICBzdGQ6OnN0cmluZyBub21lLCBtZW51OwogICAgZmxvYXQgc2FsZG8sIHZhbG9yOwogICAgc3RkOjpjb3V0IDw8ICJEaWdpdGUgc2V1IG5vbWU6IFxuIjsKICAgIHN0ZDo6Y2luID4+IG5vbWU7CiAgICBzdGQ6OmNvdXQgPDwgIkRpZ2l0ZSBvIHNhbGRvOiBcbiI7CiAgICBzdGQ6OmNpbiA+PiBzYWxkbzsKICAgIHN0ZDo6Y291dCA8PCAiRGlnaXRlIG8gdmFsb3I6IFxuIjsKICAgIHN0ZDo6Y2luID4+IHZhbG9yOwogICAgc3RkOjpjb3V0IDw8ICJEaWdpdGUgdW1hIGRhcyBvcGNvZXMgKHNhbGRvL2RlcG9zaXRvL3JldGlyYWRhKTpcbiI7CiAgICBzdGQ6OmNpbiA+PiBtZW51OwoKICAgIGlmIChtZW51ID09ICJkZXBvc2l0byIpIHsKICAgICAgICBzYWxkbyA9IHNhbG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