#include <iostream>
using namespace std;
int main() {
const int dias_semana = 7;
const int sueldo_base = 800;
int ventas[dias_semana];
int ganancia_total = 0;
// Solicitar las ventas por día
cout << "Ingrese las ventas diarias del vendedor (7 días):" << endl;
for (int i = 0; i < dias_semana; i++) {
cout << "Día " << i + 1 << ": ";
cin >> ventas[i];
}
// Calcular las ganancias por día
for (int i = 0; i < dias_semana; i++) {
int prendas = ventas[i];
int ganancia = 0;
if (prendas >= 3 && prendas <= 8) {
ganancia = prendas * 25;
} else if (prendas >= 9 && prendas <= 12) {
ganancia = prendas * 45;
} else if (prendas >= 13 && prendas <= 18) {
ganancia = prendas * 70;
}
ganancia_total += ganancia;
}
// Calcular el sueldo total semanal
int sueldo_total = sueldo_base + ganancia_total;
// Mostrar el sueldo total
cout << "El sueldo total del vendedor en la semana es: $" << sueldo_total << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBjb25zdCBpbnQgZGlhc19zZW1hbmEgPSA3OwogICAgY29uc3QgaW50IHN1ZWxkb19iYXNlID0gODAwOwogICAgaW50IHZlbnRhc1tkaWFzX3NlbWFuYV07CiAgICBpbnQgZ2FuYW5jaWFfdG90YWwgPSAwOwoKICAgIC8vIFNvbGljaXRhciBsYXMgdmVudGFzIHBvciBkw61hCiAgICBjb3V0IDw8ICJJbmdyZXNlIGxhcyB2ZW50YXMgZGlhcmlhcyBkZWwgdmVuZGVkb3IgKDcgZMOtYXMpOiIgPDwgZW5kbDsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgZGlhc19zZW1hbmE7IGkrKykgewogICAgICAgIGNvdXQgPDwgIkTDrWEgIiA8PCBpICsgMSA8PCAiOiAiOwogICAgICAgIGNpbiA+PiB2ZW50YXNbaV07CiAgICB9CgogICAgLy8gQ2FsY3VsYXIgbGFzIGdhbmFuY2lhcyBwb3IgZMOtYQogICAgZm9yIChpbnQgaSA9IDA7IGkgPCB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