最简单的解决零食问题方法(连数组方法都没用)
#include <cstdio>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
if(a == 1) printf("Total: R$ %.2lf\n" , 4.00 * b);
else if(a == 2) printf("Total: R$ %.2lf\n" , 4.50 * b);
else if(a == 3) printf("Total: R$ %.2lf\n" , 5.00 * b);
else if(a == 4) printf("Total: R$ %.2lf\n" , 2.00 * b);
else if(a == 5) printf("Total: R$ %.2lf\n" , 1.50 * b);
return 0;
}