Submit Search
Upload
Carré Magique Cpp
•
0 likes
•
640 views
Mohamed Boudchiche
Follow
Carré Magique Implémentation C++
Read less
Read more
Education
Report
Share
Report
Share
1 of 36
Download now
Download to read offline
Recommended
Du Polymorphisme dynamique au polymorphisme statique : Abstraction sans perte...
Du Polymorphisme dynamique au polymorphisme statique : Abstraction sans perte...
cppfrug
Comment développer un serveur métier en python/C++
Comment développer un serveur métier en python/C++
cppfrug
Introduction à la metaprogrammation en C++
Introduction à la metaprogrammation en C++
galinierf
Quelques notions de méta-programmation en C++
Quelques notions de méta-programmation en C++
galinierf
Développer en natif avec C++11
Développer en natif avec C++11
Microsoft
Les nouveautés de C++11 : Ecrire du C++ Moderne
Les nouveautés de C++11 : Ecrire du C++ Moderne
Microsoft
Hackers
Hackers
Mohamed Boudchiche
Parallel computing on internet
Parallel computing on internet
Mohamed Boudchiche
Recommended
Du Polymorphisme dynamique au polymorphisme statique : Abstraction sans perte...
Du Polymorphisme dynamique au polymorphisme statique : Abstraction sans perte...
cppfrug
Comment développer un serveur métier en python/C++
Comment développer un serveur métier en python/C++
cppfrug
Introduction à la metaprogrammation en C++
Introduction à la metaprogrammation en C++
galinierf
Quelques notions de méta-programmation en C++
Quelques notions de méta-programmation en C++
galinierf
Développer en natif avec C++11
Développer en natif avec C++11
Microsoft
Les nouveautés de C++11 : Ecrire du C++ Moderne
Les nouveautés de C++11 : Ecrire du C++ Moderne
Microsoft
Hackers
Hackers
Mohamed Boudchiche
Parallel computing on internet
Parallel computing on internet
Mohamed Boudchiche
DNS
DNS
Mohamed Boudchiche
part of speech tagger for ARABIC TEXT
part of speech tagger for ARABIC TEXT
arteimi
Introduction à MATLAB
Introduction à MATLAB
Mohamed Boudchiche
Développement Sous Android
Développement Sous Android
Mohamed Boudchiche
Cours rn 2006
Cours rn 2006
Mohamed Boudchiche
présentation soutenance PFE.ppt
présentation soutenance PFE.ppt
Mohamed Ben Bouzid
les_infections_a_streptocoques.pptkioljhk
les_infections_a_streptocoques.pptkioljhk
RefRama
Echos libraries Burkina Faso newsletter 2024
Echos libraries Burkina Faso newsletter 2024
Friends of African Village Libraries
Apolonia, Apolonia.pptx Film documentaire
Apolonia, Apolonia.pptx Film documentaire
Txaruka
L'expression du but : fiche et exercices niveau C1 FLE
L'expression du but : fiche et exercices niveau C1 FLE
lebaobabbleu
La mondialisation avantages et inconvénients
La mondialisation avantages et inconvénients
JaouadMhirach
Bilan énergétique des chambres froides.pdf
Bilan énergétique des chambres froides.pdf
AmgdoulHatim
L application de la physique classique dans le golf.pptx
L application de la physique classique dans le golf.pptx
hamzagame
La nouvelle femme . pptx Film français
La nouvelle femme . pptx Film français
Txaruka
Cours ofppt du Trade-Marketing-Présentation.pdf
Cours ofppt du Trade-Marketing-Présentation.pdf
achrafbrahimi1
Formation qhse - GIASE saqit_105135.pptx
Formation qhse - GIASE saqit_105135.pptx
rajaakiass01
Les roches magmatique géodynamique interne.pptx
Les roches magmatique géodynamique interne.pptx
ShinyaHilalYamanaka
Formation échiquéenne jwhyCHESS, parallèle avec la planification de projet
Formation échiquéenne jwhyCHESS, parallèle avec la planification de projet
JeanYvesMoine
CompLit - Journal of European Literature, Arts and Society - n. 7 - Table of ...
CompLit - Journal of European Literature, Arts and Society - n. 7 - Table of ...
Universidad Complutense de Madrid
Cours Généralités sur les systèmes informatiques
Cours Généralités sur les systèmes informatiques
MohammedAmineHatoch
658708519-Power-Point-Management-Interculturel.pdf
658708519-Power-Point-Management-Interculturel.pdf
MariaClaraAlves46
STRATEGIE_D’APPRENTISSAGE flee_DU_FLE.pdf
STRATEGIE_D’APPRENTISSAGE flee_DU_FLE.pdf
Gamal Mansour
More Related Content
Viewers also liked
DNS
DNS
Mohamed Boudchiche
part of speech tagger for ARABIC TEXT
part of speech tagger for ARABIC TEXT
arteimi
Introduction à MATLAB
Introduction à MATLAB
Mohamed Boudchiche
Développement Sous Android
Développement Sous Android
Mohamed Boudchiche
Cours rn 2006
Cours rn 2006
Mohamed Boudchiche
présentation soutenance PFE.ppt
présentation soutenance PFE.ppt
Mohamed Ben Bouzid
Viewers also liked
(6)
DNS
DNS
part of speech tagger for ARABIC TEXT
part of speech tagger for ARABIC TEXT
Introduction à MATLAB
Introduction à MATLAB
Développement Sous Android
Développement Sous Android
Cours rn 2006
Cours rn 2006
présentation soutenance PFE.ppt
présentation soutenance PFE.ppt
Recently uploaded
les_infections_a_streptocoques.pptkioljhk
les_infections_a_streptocoques.pptkioljhk
RefRama
Echos libraries Burkina Faso newsletter 2024
Echos libraries Burkina Faso newsletter 2024
Friends of African Village Libraries
Apolonia, Apolonia.pptx Film documentaire
Apolonia, Apolonia.pptx Film documentaire
Txaruka
L'expression du but : fiche et exercices niveau C1 FLE
L'expression du but : fiche et exercices niveau C1 FLE
lebaobabbleu
La mondialisation avantages et inconvénients
La mondialisation avantages et inconvénients
JaouadMhirach
Bilan énergétique des chambres froides.pdf
Bilan énergétique des chambres froides.pdf
AmgdoulHatim
L application de la physique classique dans le golf.pptx
L application de la physique classique dans le golf.pptx
hamzagame
La nouvelle femme . pptx Film français
La nouvelle femme . pptx Film français
Txaruka
Cours ofppt du Trade-Marketing-Présentation.pdf
Cours ofppt du Trade-Marketing-Présentation.pdf
achrafbrahimi1
Formation qhse - GIASE saqit_105135.pptx
Formation qhse - GIASE saqit_105135.pptx
rajaakiass01
Les roches magmatique géodynamique interne.pptx
Les roches magmatique géodynamique interne.pptx
ShinyaHilalYamanaka
Formation échiquéenne jwhyCHESS, parallèle avec la planification de projet
Formation échiquéenne jwhyCHESS, parallèle avec la planification de projet
JeanYvesMoine
CompLit - Journal of European Literature, Arts and Society - n. 7 - Table of ...
CompLit - Journal of European Literature, Arts and Society - n. 7 - Table of ...
Universidad Complutense de Madrid
Cours Généralités sur les systèmes informatiques
Cours Généralités sur les systèmes informatiques
MohammedAmineHatoch
658708519-Power-Point-Management-Interculturel.pdf
658708519-Power-Point-Management-Interculturel.pdf
MariaClaraAlves46
STRATEGIE_D’APPRENTISSAGE flee_DU_FLE.pdf
STRATEGIE_D’APPRENTISSAGE flee_DU_FLE.pdf
Gamal Mansour
RAPPORT DE STAGE D'INTERIM DE ATTIJARIWAFA BANK
RAPPORT DE STAGE D'INTERIM DE ATTIJARIWAFA BANK
NassimaMdh
Copie de Engineering Software Marketing Plan by Slidesgo.pptx.pptx
Copie de Engineering Software Marketing Plan by Slidesgo.pptx.pptx
ikospam0
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...
Nguyen Thanh Tu Collection
Intégration des TICE dans l'enseignement de la Physique-Chimie.pptx
Intégration des TICE dans l'enseignement de la Physique-Chimie.pptx
abdououanighd
Recently uploaded
(20)
les_infections_a_streptocoques.pptkioljhk
les_infections_a_streptocoques.pptkioljhk
Echos libraries Burkina Faso newsletter 2024
Echos libraries Burkina Faso newsletter 2024
Apolonia, Apolonia.pptx Film documentaire
Apolonia, Apolonia.pptx Film documentaire
L'expression du but : fiche et exercices niveau C1 FLE
L'expression du but : fiche et exercices niveau C1 FLE
La mondialisation avantages et inconvénients
La mondialisation avantages et inconvénients
Bilan énergétique des chambres froides.pdf
Bilan énergétique des chambres froides.pdf
L application de la physique classique dans le golf.pptx
L application de la physique classique dans le golf.pptx
La nouvelle femme . pptx Film français
La nouvelle femme . pptx Film français
Cours ofppt du Trade-Marketing-Présentation.pdf
Cours ofppt du Trade-Marketing-Présentation.pdf
Formation qhse - GIASE saqit_105135.pptx
Formation qhse - GIASE saqit_105135.pptx
Les roches magmatique géodynamique interne.pptx
Les roches magmatique géodynamique interne.pptx
Formation échiquéenne jwhyCHESS, parallèle avec la planification de projet
Formation échiquéenne jwhyCHESS, parallèle avec la planification de projet
CompLit - Journal of European Literature, Arts and Society - n. 7 - Table of ...
CompLit - Journal of European Literature, Arts and Society - n. 7 - Table of ...
Cours Généralités sur les systèmes informatiques
Cours Généralités sur les systèmes informatiques
658708519-Power-Point-Management-Interculturel.pdf
658708519-Power-Point-Management-Interculturel.pdf
STRATEGIE_D’APPRENTISSAGE flee_DU_FLE.pdf
STRATEGIE_D’APPRENTISSAGE flee_DU_FLE.pdf
RAPPORT DE STAGE D'INTERIM DE ATTIJARIWAFA BANK
RAPPORT DE STAGE D'INTERIM DE ATTIJARIWAFA BANK
Copie de Engineering Software Marketing Plan by Slidesgo.pptx.pptx
Copie de Engineering Software Marketing Plan by Slidesgo.pptx.pptx
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI DẠY BUỔI 2) - TIẾNG ANH 6, 7 GLOBAL SUCCESS (2...
Intégration des TICE dans l'enseignement de la Physique-Chimie.pptx
Intégration des TICE dans l'enseignement de la Physique-Chimie.pptx
Carré Magique Cpp
1.
TP1:Carré Magique Implementation C++ Mohamed
Boudchiche M.R.I. 27 décembre 2012
2.
main.cpp
Solution.h Solution.cpp Etudiant: Mohamed Boudchiche TP1:Carré Magique
3.
main.cpp
Solution.h Solution.cpp main.cpp Etudiant: Mohamed Boudchiche TP1:Carré Magique
4.
main.cpp
Solution.h Solution.cpp main.cpp Solution.h Etudiant: Mohamed Boudchiche TP1:Carré Magique
5.
main.cpp
Solution.h Solution.cpp main.cpp Solution.h Solution.cpp Etudiant: Mohamed Boudchiche TP1:Carré Magique
6.
main.cpp
Solution.h Solution.cpp #include <cstdlib> #include <iostream> #include "Solution.h" using namespace std ; int main(int argc, char *argv[]) { int premier[]={1,2,3,4,5,6,7,8,9} ; int dernier[]={9,8,7,6,5,4,3,2,1} ; solution first(premier) ; solution last(dernier) ; solution curent ; int iteration=1 ; for(curent=first ;curent<=last ;curent++) { Etudiant: Mohamed Boudchiche TP1:Carré Magique
7.
main.cpp
Solution.h Solution.cpp if(curent.isMagic()) curent.print() ; iteration++ ; } cout«"Nombre iteration : "«k«endl ; system("PAUSE") ; return 0 ; } } Etudiant: Mohamed Boudchiche TP1:Carré Magique
8.
main.cpp
Solution.h Solution.cpp Etudiant: Mohamed Boudchiche TP1:Carré Magique
9.
main.cpp
Solution.h Solution.cpp class solution Etudiant: Mohamed Boudchiche TP1:Carré Magique
10.
main.cpp
Solution.h Solution.cpp class solution { Etudiant: Mohamed Boudchiche TP1:Carré Magique
11.
main.cpp
Solution.h Solution.cpp class solution { private : Etudiant: Mohamed Boudchiche TP1:Carré Magique
12.
main.cpp
Solution.h Solution.cpp class solution { private : int permt[9] ; Etudiant: Mohamed Boudchiche TP1:Carré Magique
13.
main.cpp
Solution.h Solution.cpp class solution { private : int permt[9] ; public : Etudiant: Mohamed Boudchiche TP1:Carré Magique
14.
main.cpp
Solution.h Solution.cpp class solution { private : int permt[9] ; public : solution() ; Etudiant: Mohamed Boudchiche TP1:Carré Magique
15.
main.cpp
Solution.h Solution.cpp class solution { private : int permt[9] ; public : solution() ; solution(int []) ; Etudiant: Mohamed Boudchiche TP1:Carré Magique
16.
main.cpp
Solution.h Solution.cpp class solution { private : int permt[9] ; public : solution() ; solution(int []) ; solution( const solution&) ; Etudiant: Mohamed Boudchiche TP1:Carré Magique
17.
main.cpp
Solution.h Solution.cpp class solution { private : int permt[9] ; public : solution() ; solution(int []) ; solution( const solution&) ; solution& operator=(const solution&) ; Etudiant: Mohamed Boudchiche TP1:Carré Magique
18.
main.cpp
Solution.h Solution.cpp class solution { private : int permt[9] ; public : solution() ; solution(int []) ; solution( const solution&) ; solution& operator=(const solution&) ; void print() const ; Etudiant: Mohamed Boudchiche TP1:Carré Magique
19.
main.cpp
Solution.h Solution.cpp class solution { private : int permt[9] ; public : solution() ; solution(int []) ; solution( const solution&) ; solution& operator=(const solution&) ; void print() const ; bool isMagic() const ; Etudiant: Mohamed Boudchiche TP1:Carré Magique
20.
main.cpp
Solution.h Solution.cpp class solution { private : int permt[9] ; public : solution() ; solution(int []) ; solution( const solution&) ; solution& operator=(const solution&) ; void print() const ; bool isMagic() const ; bool operator<=(const solution&) ; Etudiant: Mohamed Boudchiche TP1:Carré Magique
21.
main.cpp
Solution.h Solution.cpp class solution { private : int permt[9] ; public : solution() ; solution(int []) ; solution( const solution&) ; solution& operator=(const solution&) ; void print() const ; bool isMagic() const ; bool operator<=(const solution&) ; solution& operator++(int) ; Etudiant: Mohamed Boudchiche TP1:Carré Magique
22.
main.cpp
Solution.h Solution.cpp class solution { private : int permt[9] ; public : solution() ; solution(int []) ; solution( const solution&) ; solution& operator=(const solution&) ; void print() const ; bool isMagic() const ; bool operator<=(const solution&) ; solution& operator++(int) ; }; Etudiant: Mohamed Boudchiche TP1:Carré Magique
23.
solution() ; solution(int
a[9]) ; solution(const solution& b) operator=(const solution& b) main.cpp operator<=(const solution& last) Solution.h solution& solution : :operator++(int n) Solution.cpp bool solution : :isMagic() const void solution : :print() const solution : :solution() { } Etudiant: Mohamed Boudchiche TP1:Carré Magique
24.
solution() ; solution(int
a[9]) ; solution(const solution& b) operator=(const solution& b) main.cpp operator<=(const solution& last) Solution.h solution& solution : :operator++(int n) Solution.cpp bool solution : :isMagic() const void solution : :print() const solution : :solution() { } solution : :solution(int a[9]) { for(int i=0 ;i<9 ;i++) permt[i]=a[i] ; } Etudiant: Mohamed Boudchiche TP1:Carré Magique
25.
solution() ; solution(int
a[9]) ; solution(const solution& b) operator=(const solution& b) main.cpp operator<=(const solution& last) Solution.h solution& solution : :operator++(int n) Solution.cpp bool solution : :isMagic() const void solution : :print() const solution : :solution() { } solution : :solution(int a[9]) { for(int i=0 ;i<9 ;i++) permt[i]=a[i] ; } solution : :solution(const solution& b) { for(int i=0 ;i<9 ;i++) permt[i]=b.permt[i] ; } Etudiant: Mohamed Boudchiche TP1:Carré Magique
26.
solution() ; solution(int
a[9]) ; solution(const solution& b) operator=(const solution& b) main.cpp operator<=(const solution& last) Solution.h solution& solution : :operator++(int n) Solution.cpp bool solution : :isMagic() const void solution : :print() const solution& solution : :operator=(const solution& b) { for(int i=0 ;i<9 ;i++) permt[i]=b.permt[i] ; return *this ; } Etudiant: Mohamed Boudchiche TP1:Carré Magique
27.
solution() ; solution(int
a[9]) ; solution(const solution& b) operator=(const solution& b) main.cpp operator<=(const solution& last) Solution.h solution& solution : :operator++(int n) Solution.cpp bool solution : :isMagic() const void solution : :print() const bool solution : :operator<=(const solution& last) { int k=0 ; for(int i=0 ;i<9 ;i++) { if(permt[i]<last.permt[i]) return true ; if(permt[i]=last.permt[i]) k++ ; } if(k==9-1)return true ; else return false ; } Etudiant: Mohamed Boudchiche TP1:Carré Magique
28.
solution() ; solution(int
a[9]) ; solution(const solution& b) operator=(const solution& b) main.cpp operator<=(const solution& last) Solution.h solution& solution : :operator++(int n) Solution.cpp bool solution : :isMagic() const void solution : :print() const solution& solution : :operator++(int n) { solution& copy = *this ; for (int a = 9 - 2 ; a >= 0 ; –a) if (copy.permt[a] < copy.permt[a + 1]) for(int b = 9 - 1 ;b>=0 ; –b) if (copy.permt[b] > copy.permt[a]) { int t = copy.permt[a] ; copy.permt[a] = copy.permt[b] ; copy.permt[b] = t ; for (++a, b = 9 - 1 ; a < b ; ++a, –b) { t = copy.permt[a] ; Etudiant: Mohamed Boudchiche TP1:Carré Magique
29.
solution() ; solution(int
a[9]) ; solution(const solution& b) operator=(const solution& b) main.cpp operator<=(const solution& last) Solution.h solution& solution : :operator++(int n) Solution.cpp bool solution : :isMagic() const void solution : :print() const copy.permt[a] = copy.permt[b] ; copy.permt[b] = t ; } return copy ; } return *this ; } Etudiant: Mohamed Boudchiche TP1:Carré Magique
30.
solution() ; solution(int
a[9]) ; solution(const solution& b) operator=(const solution& b) main.cpp operator<=(const solution& last) Solution.h solution& solution : :operator++(int n) Solution.cpp bool solution : :isMagic() const void solution : :print() const bool solution : :isMagic() const { int som = 15 ;//(9*(9*9 +1))/2 ; int S ; Etudiant: Mohamed Boudchiche TP1:Carré Magique
31.
solution() ; solution(int
a[9]) ; solution(const solution& b) operator=(const solution& b) main.cpp operator<=(const solution& last) Solution.h solution& solution : :operator++(int n) Solution.cpp bool solution : :isMagic() const void solution : :print() const bool solution : :isMagic() const { int som = 15 ;//(9*(9*9 +1))/2 ; int S ; //–––-> Ligne for(int j=0 ;j<3 ;j++){ S=0 ; for(int i=0 ;i<3 ;i++) S+=permt[i+j*3] ; if(som !=S) return false ; } Etudiant: Mohamed Boudchiche TP1:Carré Magique
32.
solution() ; solution(int
a[9]) ; solution(const solution& b) operator=(const solution& b) main.cpp operator<=(const solution& last) Solution.h solution& solution : :operator++(int n) Solution.cpp bool solution : :isMagic() const void solution : :print() const bool solution : :isMagic() const { int som = 15 ;//(9*(9*9 +1))/2 ; int S ; //–––-> Ligne for(int j=0 ;j<3 ;j++){ S=0 ; for(int i=0 ;i<3 ;i++) S+=permt[i+j*3] ; if(som !=S) return false ; } //–––-> Colone for(int j=0 ;j<3 ;j++){ S=0 ; for(int i=0 ;i<3 ;i++)S+=permt[j+i*3] ; if(som !=S) return false ; } Etudiant: Mohamed Boudchiche TP1:Carré Magique
33.
solution() ; solution(int
a[9]) ; solution(const solution& b) operator=(const solution& b) main.cpp operator<=(const solution& last) Solution.h solution& solution : :operator++(int n) Solution.cpp bool solution : :isMagic() const void solution : :print() const Etudiant: Mohamed Boudchiche TP1:Carré Magique
34.
solution() ; solution(int
a[9]) ; solution(const solution& b) operator=(const solution& b) main.cpp operator<=(const solution& last) Solution.h solution& solution : :operator++(int n) Solution.cpp bool solution : :isMagic() const void solution : :print() const //–––-> Diagonale S=0 ; for(int i=0 ;i<3 ;i++)S+=permt[i+i*3] ; if(som !=S) return false ; Etudiant: Mohamed Boudchiche TP1:Carré Magique
35.
solution() ; solution(int
a[9]) ; solution(const solution& b) operator=(const solution& b) main.cpp operator<=(const solution& last) Solution.h solution& solution : :operator++(int n) Solution.cpp bool solution : :isMagic() const void solution : :print() const //–––-> Diagonale S=0 ; for(int i=0 ;i<3 ;i++)S+=permt[i+i*3] ; if(som !=S) return false ; //–––-> AntiDiagonale S=0 ; for(int i=0 ;i<3 ;i++)S+=permt[3-1-i+i*3] ; if(som !=S) return false ; return true ; } Etudiant: Mohamed Boudchiche TP1:Carré Magique
36.
solution() ; solution(int
a[9]) ; solution(const solution& b) operator=(const solution& b) main.cpp operator<=(const solution& last) Solution.h solution& solution : :operator++(int n) Solution.cpp bool solution : :isMagic() const void solution : :print() const void solution : :print() const { for(int i=0 ;i<3 ;i++) { cout « "+–-+–-+–-+"« endl ; for(int j=0 ;j<3 ;j++) cout « "| "« permt[j+i*3] « " " ; cout « "+–-+–-+–-+"« endl « endl ; } } Etudiant: Mohamed Boudchiche TP1:Carré Magique
Download now