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
David Rothbauer
Mapa I
Commits
a7edf423
Commit
a7edf423
authored
4 years ago
by
David Rothbauer
Browse files
Options
Download
Email Patches
Plain Diff
Add new file
parents
master
No related merge requests found
Pipeline
#1281
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mapaI.cpp
+36
-0
mapaI.cpp
with
36 additions
and
0 deletions
+36
-0
mapaI.cpp
0 → 100644
+
36
-
0
View file @
a7edf423
#include
<iostream>
#include
<stdio.h>
#include
<string>
using
namespace
std
;
int
x
,
y
;
//rozmery mrizky
int
faktorial
(
int
cislo
)
{
//rekuzivni funkce pro vypocet faktorialu
if
(
cislo
>=
1
)
{
return
cislo
*
faktorial
(
cislo
-
1
);
}
else
{
return
1
;
}
}
int
vypocet
(
int
a
,
int
b
)
{
if
(
a
==
0
)
{
//kvuli indexum od 0 se zde pripadne pricte 1
a
=
1
;
}
if
(
b
==
0
)
{
b
=
1
;
}
int
m
=
faktorial
(
a
+
b
);
//vzorec z kombinatoriky z internetu
int
n
=
faktorial
(
a
)
*
faktorial
(
b
);
return
m
/
n
;
}
int
main
()
{
cin
>>
x
>>
y
;
//precteni rozmeru od uzivatele
cout
<<
vypocet
(
x
-
1
,
y
-
1
);
//zavolani funkce s parametry od uzivatele
}
\ 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