Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
slabype
Nté prvocislo
Commits
7ea20dfc
Commit
7ea20dfc
authored
4 years ago
by
slabype
Browse files
Options
Download
Email Patches
Plain Diff
odevzdání úkolu
parent
aec7cbbe
No related merge requests found
Pipeline
#1786
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
prvocislo.cpp
+41
-0
prvocislo.cpp
with
41 additions
and
0 deletions
+41
-0
prvocislo.cpp
0 → 100644
+
41
-
0
View file @
7ea20dfc
#include
<iostream>
using
namespace
std
;
int
main
()
{
int
n
;
int
r
=
0
;
int
onetwo
=
0
;
int
result
;
int
divider
=
1
;
int
number
=
2
;
cout
<<
(
"Napis cislo"
);
cin
>>
n
;
while
(
n
!=
r
)
{
if
(
number
>=
divider
)
{
if
(
onetwo
%
divider
==
0
)
{
onetwo
++
;
if
(
onetwo
==
2
&&
number
==
divider
)
{
r
++
;
result
=
number
;
}
}
divider
++
;
}
else
{
number
++
;
divider
=
1
;
onetwo
=
0
;
}
}
cout
<<
result
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets