-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmachine1.cpp
48 lines (28 loc) · 953 Bytes
/
machine1.cpp
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
#include<iostream>
#include<deque>
#include<iterator>
#include"machine1.h"
#include"grille.h"
#include<utility>
using namespace std;
/*******************************************************************************************************************/
void Machine1::tri2()
{
int i, j;
for (i = 0; i < 81; ++i) {
deque<int> elem(m[i].begin(),m[i].end());
// elem=assign(m[i].begin(),m[i].end());
for (j = i; j > 0 && m[j-1].back() > elem.back(); j--)
m[j].assign(m[j-1].begin(),m[j-1].end());
m[j].assign(elem.begin(),elem.end());
}
}
/**************************************************************************************************************************/
bool Machine1::resoudre(Grille g)
{
remplir(g);
tri2();
Resoudre(g,0);
return true;
}
/**************************************************************************************************************************/