Last active
January 1, 2016 15:19
-
-
Save hemache/8163172 to your computer and use it in GitHub Desktop.
Gist for ravha !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <conio.h> | |
| void main() | |
| { | |
| int i; | |
| char ville[20]; | |
| int nbr_visi_tang, nbr_visi_tet, nbr_visi_aga, nbr_visi_tan; | |
| int age; | |
| int tot_tang, tot_aga, tot_tet, tot_tan, tot_gen; | |
| clrscr(); | |
| printf("Beinvenu\n\n"); | |
| for(i=1; i<=2; i++) | |
| { | |
| printf("Voyagent numero %d", i); | |
| printf("votre age: "); scanf("%d", &age); | |
| if(age > 30) | |
| { | |
| printf("achmen ville baghi temchi, tanger wla tetouan ? "); scanf("%s", ville); | |
| if(strcmp(ville, "tanger") ==0) | |
| { | |
| nbr_visi_tang++; | |
| tot_tang += 300; | |
| } | |
| else if(strcmp(ville, "tetouan") == 0) | |
| { | |
| nbr_visi_tet++; | |
| tot_tet += 250; | |
| } | |
| } | |
| else if(age <= 30) | |
| { | |
| printf("achmen ville baghi temchi, tantan wla agadir ? "); scanf("%s", ville); | |
| if(strcmp(ville, "tantan") ==0) | |
| { | |
| nbr_visi_tan++; | |
| tot_tan += 350; | |
| } | |
| else if(strcmp(ville, "agadir") == 0) | |
| { | |
| nbr_visi_aga++; | |
| tot_aga += 100; | |
| } | |
| } | |
| } | |
| total_gen = tot_aga + tot_tan + tot_tang + tot_tet; | |
| printf(" Total General : %d \n", total_gen); | |
| printf(" Le nombre de personne qui voyagent … Agadir est : %d \n", nbr_visi_aga); | |
| printf(" Le nombre de personne qui voyagent … Tantan est : %d \n", nbr_visi_tan); | |
| printf(" Le nombre de personne qui voyagent … Tanger est : %d \n", nbr_visi_tang); | |
| printf(" Le nombre de personne qui voyagent … Tetouan est : %d \n", nbr_visi_tet); | |
| printf(" Totat … Agadir est : %d DH\n", tot_aga); | |
| printf(" Totat … Tantan est : %d DH\n", tot_tan); | |
| printf(" Totat … Tanger est : %d DH\n", tot_tang); | |
| printf(" Totat … Tetouan est : %d DH\n", tot_tet); | |
| getch(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment