Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
alxm2023
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
alxm2023
Commits
7978c885
Commit
7978c885
authored
Dec 07, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rozwiązana silnia
parent
6e8c9182
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
silnia.cpp
20231207/silnia.cpp
+9
-3
No files found.
20231207/silnia.cpp
View file @
7978c885
...
...
@@ -4,13 +4,19 @@ using namespace std;
// Napisz funkcję silnia, która oblicza iloczyn liczb naturalnych od 1 do n włącznie
// silnia(n) = 1 * 2 * ... * n
// Np. silnia(5) = 1*2*3*4*5 = 120
int
silnia
(
int
n
)
{
// Dla typu wynikowego unsigned long long poprawne będą wyniki do 20!
unsigned
long
long
silnia
(
int
n
)
{
unsigned
long
long
iloczyn
=
1
;
for
(
int
i
=
2
;
i
<=
n
;
i
++
)
{
iloczyn
=
iloczyn
*
i
;
}
return
iloczyn
;
}
int
main
()
{
int
parametr
,
wynik
;
int
parametr
;
unsigned
long
long
wynik
;
do
{
cout
<<
"Podaj liczbę: "
<<
flush
;
cin
>>
parametr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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