Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Cin-cout
#include <iostream>
using namespace std;
Scanf-Printf
#include <iostream>
#include <stdio.h>
using namespace std;
Cin-Cout
#include <iostream>
using namespace std;
return 0;
}
Printf-scanf
#include <iostream>
#include <stdio.h>
using namespace std;
return 0;
}
Cin-cout
#include <iostream>
using namespace std;
}
return 0;
}
Printf-scanf
#include <iostream>
#include <stdio.h>
using namespace std;
Cin-cout
#include <iostream>
using namespace std;
Cin-cout
#include <iostream>
using namespace std;
scanf("%d",&valor);
printf("\nCuantos kilos desea comprar?" );
scanf("%d",&kilos);
if (kilos>=0 and kilos<=2) {
desc=valor*kilos;
total=desc;
} else {
if (kilos>=2.01 and kilos<=5) {
desc=(valor*kilos)*0.1;
total=(valor*kilos)-desc;
} else {
if (kilos>=5.01 and kilos<=10) {
desc=(valor*kilos)*0.15;
total=(valor*kilos)-desc;
} else {
desc=(valor*kilos)*0.2;
total=(valor*kilos)-desc;
}
}
}
printf("\nEl total de la compra es de: $%d",total);
return 0;
}