Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Prochaine révision Les deux révisions suivantes | ||
compilation [Le 14/05/2017, 20:10] 41.251.79.121 [Langages C/C++] |
compilation [Le 26/12/2017, 13:03] L'Africain lien |
||
---|---|---|---|
Ligne 11: | Ligne 11: | ||
Voir le tutoriel [[tutoriel:compilation|Installer un logiciel ou une bibliothèque par compilation]]. | Voir le tutoriel [[tutoriel:compilation|Installer un logiciel ou une bibliothèque par compilation]]. | ||
- | #include <iostream> | + | ===== Langages C/C++ ====== |
- | #include <string> | + | |
- | #include<fstream> | + | |
- | using namespace std; | + | |
- | const int semestre =6; | + | |
- | void saisie(float [], int , int ); | + | |
- | int i,moyenne;float som; | + | |
- | struct smp{string nom; | + | |
- | string prenom; | + | |
- | float note[6]; | + | |
- | }; | + | |
- | main(){smp etudiant; | + | |
- | ofstream file; | + | |
- | file.open("devoir.dat"); | + | |
- | for(int j=1;j<=20;j++){cout<<"\nsaisir le nom : \t";cin>>etudiant.nom; | + | |
- | cout<<"\nsaisir le prenom : \t";cin>>etudiant.prenom; | + | |
- | file<<etudiant.nom<<"\t"<<etudiant.prenom; | + | |
- | file<<"\n======================================================\n"; | + | |
- | for(int nsession =1;nsession <= semestre;nsession ++){saisie(etudiant.note , 6 ,nsession); | + | |
- | for(i=0;i<6;i++) file<<etudiant.note[i]<<"\t";som=etudiant.note[0]+etudiant.note[1]+etudiant.note[2]+etudiant.note[3]+etudiant.note[4]+etudiant.note[5];moyenne=som/6; | + | |
- | switch(moyenne){ | + | |
- | case 10:{file<<"moyenne"<<endl;break;} | + | |
- | case 11:{file<<"passable"<<endl;break;} | + | |
- | case 12:{file<<"a.bien"<<endl;break;} | + | |
- | case 13:{file<<"a.bien"<<endl;break;} | + | |
- | case 14:{file<<"bien"<<endl;break;} | + | |
- | case 15:{file<<"bien"<<endl;break;} | + | |
- | case 16:{file<<"t.bien"<<endl;break;} | + | |
- | case 17:{file<<"t.bien"<<endl;break;} | + | |
- | case 18:{file<<"exillent"<<endl;break;} | + | |
- | case 19:{file<<"exillent"<<endl;break;} | + | |
- | case 20:{file<<"rak jan assat"<<endl;break;} | + | |
- | default: | + | |
- | file<<"ajournee"<<endl; | + | |
- | } | + | |
- | file<<"moyenne"<<nsession<<":"<<moyenne; | + | |
- | file<<endl;}} | + | |
- | file.close(); | + | |
- | } | + | |
- | void saisie(float tab[],int n,int ns){ | + | |
- | float *p =&tab[0]; | + | |
- | cout<<"\n semestre :\t"<<ns; | + | |
- | cout<<"saisir ls notes des 6 modules :\n"; | + | |
- | while(p<tab+n){cin>>*p;p++;} | + | |
- | } | + | |
==== Installation du compilateur GNU C et du compilateur GNU C++ ==== | ==== Installation du compilateur GNU C et du compilateur GNU C++ ==== | ||
Ligne 114: | Ligne 71: | ||
*[[fpc]] - Compilateur Free Pascal, utilisé par l'IDE [[Lazarus]]. | *[[fpc]] - Compilateur Free Pascal, utilisé par l'IDE [[Lazarus]]. | ||
- | *[[gpc]] - Compilateur Pascal GNU. | + | |
Ligne 121: | Ligne 78: | ||
Langage développé en France par l'INRIA ([[http://caml.inria.fr/]]). | Langage développé en France par l'INRIA ([[http://caml.inria.fr/]]). | ||
- | * [[ocamlc]] et [[ocamlopt]] - Compilateur bytecode et code natif. | + | * **[[apt>ocaml]]** et **ocamlopt** - Compilateur bytecode et code natif. |
- | * [[js_of_ocaml]] - Compilateur vers JavaScript. | + | * **js_of_ocaml** - Compilateur vers JavaScript. |
===== Installation des outils GNU autotools ===== | ===== Installation des outils GNU autotools ===== | ||