Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // main.cpp
- // exo1-TP1
- //
- // Created by Dylan BUTELLE on 30/01/2020.
- // Copyright © 2020 Dylan BUTELLE. All rights reserved.
- //
- #include <iostream>
- #include <array>
- using namespace std;
- int main(){
- int exemplaires=0,CA=0;
- const int VOITURES=4;
- const int VENDEURS=5;
- array<array<int,VOITURES>,VENDEURS>ventes;
- array<int,VOITURES>prix;
- prix[0]=11000;
- prix[1]=16000;
- prix[2]=14000;
- prix[3]=20000;
- for(int i=0;i<VENDEURS;i++)
- {
- cout<<"Entrer les ventes du vendeur no "<<i+1<<" dans l'ordre des modèles : "<<endl;
- for(int j=0;j<VOITURES;j++)
- {
- cin>>ventes[i][j];
- }
- }
- for(int i=0;i<VENDEURS;i++)
- {
- cout<<endl;
- for(int j=0;j<VOITURES;j++)
- {
- cout<<ventes[i][j]<<"\t";
- }
- }
- cout<<endl;
- for(int j=0;j<VOITURES;j++)
- {
- exemplaires=0;
- for(int i=0;i<VENDEURS;i++)
- {
- exemplaires+=ventes[i][j];
- }
- cout<<"Modèle no "<<j+1<<" : "<<exemplaires<<endl;
- }
- for(int i=0;i<VENDEURS;i++)
- {
- CA=0;
- cout<<endl;
- for(int j=0;j<VOITURES;j++)
- {
- CA+=ventes[i][j]*prix[j];
- }
- cout<<"Chiffre d'affaire no "<<i+1<<" = "<<CA<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement