Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- float precios[4][4];
- bool vajilla[4][4] = {0};
- int platos;
- float costo = 0;
- float descontar = 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;
- vajilla[i][j] = true;
- costo += precios[i][j];
- }
- for(int i=0; i<4; i++){
- bool des = true;
- for(int j=0; j<4; j++)
- if( vajilla[i][j]==0 )
- des = false;
- if( des )
- descontar += 10;
- }
- cout << costo-descontar;
- return 0;
- }
Add Comment
Please, Sign In to add comment