Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- float precios[4][4];
- int vajillas[4]={0};
- int platos;
- float costo = 0.0;
- float descontar=0.0;
- for(int i=0; i<4; i++)
- for(int j=0; j<4; j++)
- cin >> precios[i][j];
- cin >> platos;
- for(int k=0; k<platos; k++){
- string cad;
- cin >> cad;
- int i = cad[0] - 'A';
- int j = cad[1] - '0' - 1;
- vajillas[i] += j+1;
- costo += precios[i][j];
- }
- for(int i=0; i<4; i++)
- descontar += (vajillas[i]/10)*10;
- cout << costo-descontar;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement