1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
| #include<utility.h>
#include<stdio.h>
void main(void)
{
int prest1,prest2,prest3,px1prest,px2prest,px3prest,nbrechbre,i,duree,codeprest,N,var,X;
float tarifchbre,coutchbre,tarifprest,coutsej;
Cls();
prest1=1;
prest2=2 ;
prest3=3;
px1prest=5;
px2prest=10;
px3prest=15;
X=0;
var=0;
printf("combien de patients voulez vous traiter?: \n ");
scanf("%i",&X);
while(var>=X)
{
printf("combien de chambres pour ce patient?: \n ");
scanf("%i",&N);
coutchbre=0;
coutsej=0;
for (i=1;i<=N; i++)
{
printf("quel est le tarif journalier de la chambre?: \n ");
scanf("%f",&tarifchbre);
printf("quelle durée?: \n ");
scanf("%i",&duree);
printf("quel est le code prestation choisie?: \n ");
scanf("%i",&codeprest);
if (codeprest=prest1 )
{
tarifprest=px1prest;
}
if (codeprest=prest2)
{
tarifprest=px2prest;
}
if( codeprest=prest3 )
{
tarifprest=px3prest;
}
coutchbre=((tarifchbre + tarifprest)*duree);
coutsej=coutsej+coutchbre;
}
printf("Le cout de sejour de ce patient est de: \n %f",coutsej);
}
var=var+1;
} |
Partager