Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sudoku_apa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
btomi96
sudoku_apa
Commits
0c4e5652
Commit
0c4e5652
authored
May 9, 2018
by
Tamas Bunth
Browse files
Options
Downloads
Patches
Plain Diff
Read elements and size of map from file
parent
e6b6cd37
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
input.txt
+10
-0
10 additions, 0 deletions
input.txt
program.cxx
+30
-13
30 additions, 13 deletions
program.cxx
result.txt
+40
-0
40 additions, 0 deletions
result.txt
with
80 additions
and
13 deletions
input.txt
0 → 100644
+
10
−
0
View file @
0c4e5652
5
1 2
3 4 5
2 5 4
5 3
3 1 2
4 1 2
1 3 5
1 4 5
3 2 4
This diff is collapsed.
Click to expand it.
program.cxx
+
30
−
13
View file @
0c4e5652
#include
<list>
#include
"processor.hxx"
#include
"matrix.hxx"
#include
<iostream>
#include
<fstream>
#include
<sstream>
int
main
()
int
main
(
int
argc
,
char
**
argv
)
{
Matrix
matrix
{
5
};
if
(
argc
<
2
)
{
std
::
cerr
<<
"Too few arguments. Expected file path."
<<
std
::
endl
;
return
-
1
;
}
std
::
string
path
{
argv
[
1
]};
std
::
ifstream
input
{
path
};
std
::
string
line
;
getline
(
input
,
line
);
// size of matrix
size_t
nMatrixSize
=
std
::
stoi
(
line
);
Matrix
matrix
{
nMatrixSize
};
std
::
list
<
Element
>
els
;
els
.
push_back
(
Element
{
{
1
,
2
}
});
els
.
push_back
(
Element
{
{
3
,
4
,
5
}
});
els
.
push_back
(
Element
{
{
2
,
5
,
4
}
});
els
.
push_back
(
Element
{
{
5
,
3
}
});
els
.
push_back
(
Element
{
{
3
,
1
,
2
}
});
els
.
push_back
(
Element
{
{
4
,
1
,
2
}
});
els
.
push_back
(
Element
{
{
1
,
3
,
5
}
});
els
.
push_back
(
Element
{
{
1
,
4
,
5
}
});
els
.
push_back
(
Element
{
{
3
,
2
,
4
}
});
while
(
getline
(
input
,
line
)
)
{
std
::
istringstream
iss
(
line
);
std
::
string
word
;
std
::
vector
<
Symbol
>
symbols
;
while
(
std
::
getline
(
iss
,
word
,
' '
))
{
symbols
.
push_back
(
std
::
stoi
(
word
));
}
els
.
push_back
(
Element
{
symbols
});
}
Processor
proci
{
matrix
};
proci
.
process
(
els
);
return
0
;
}
This diff is collapsed.
Click to expand it.
result.txt
0 → 100644
+
40
−
0
View file @
0c4e5652
Alakzatok
=========
1: háromszög
2: négyzet
3: kör
4: szív
5: hold
Megoldás
========
_______
5| 4| 3 1 2
| | ____
4| 1| 2| 5 3
| | |
3| 2| 1| 4| 5|
_______ | |
1 3 5 2| 4|
_______ | |
2 5 4 3| 1|
Elemek (bal fölső sarokból kiindulva)
======
5, 4, 3
4, 1, 2,
3, 1, 2,
2, 1,
5, 3,
4, 2, 3
5, 4, 1,
1, 3, 5,
2, 5, 4,
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment