YAMILDIAZ

prueba del punto 2 parcial

Jun 24th, 2023
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | Source Code | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4.  
  5.  
  6. int main(){
  7.  int idCliente, idTorta;
  8.  int mCanTorta[10][3]={};
  9.  
  10.  cout<<"cliente: ";
  11.  cin>>idCliente;
  12.  
  13.  while(idCliente >= 0){
  14.  cout<<"torta: ";
  15.  cin>>idTorta;
  16.  
  17. mCanTorta[idCliente-1][idTorta-1]++;
  18.  
  19.   cout<<"cliente: ";
  20.   cin>>idCliente;
  21.  }
  22.  
  23.  for(int f = 0; f < 10; f++){
  24.     for(int c = 0; c < 3; c++){
  25.         cout<<mCanTorta[f][c]<<"\t";
  26.     }
  27.     cout<<endl;
  28.  }
  29.   for(int f = 0; f < 10; f++){
  30.     for(int c = 0; c < 3; c++){
  31.         if(mCanTorta[f][c]>1){
  32.             cout<<f+1<<endl;
  33.         }
  34.     }
  35.     cout<<endl;
  36.  }
  37.  
  38. }
  39.  
Advertisement
Add Comment
Please, Sign In to add comment