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
2da5e37b
Commit
2da5e37b
authored
Oct 19, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lekcja 3
parent
557fe5c7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
12 deletions
+76
-12
prostokat.cpp
20231012/prostokat.cpp
+7
-5
rozmowa.cpp
20231012/rozmowa.cpp
+6
-7
losowanie.cpp
20231019/losowanie.cpp
+17
-0
sprawdz_wiek.cpp
20231019/sprawdz_wiek.cpp
+23
-0
zagadka.cpp
20231019/zagadka.cpp
+23
-0
No files found.
20231012/prostokat.cpp
View file @
2da5e37b
...
@@ -4,10 +4,12 @@ using namespace std;
...
@@ -4,10 +4,12 @@ using namespace std;
int
main
()
int
main
()
{
{
cout
<<
"Jak masz na imie?"
<<
endl
;
double
a
,
b
;
string
imie
;
cout
<<
"Podaj pierwszy bok: "
;
cin
>>
imie
;
cin
>>
a
;
cout
<<
"Witaj "
<<
imie
<<
endl
;
cout
<<
"Podaj drugi bok: "
;
cin
>>
b
;
cout
<<
"Pole prostokata: "
<<
a
*
b
<<
endl
;
cout
<<
"Obwod prostokata: "
<<
2
*
a
+
2
*
b
<<
endl
;
return
0
;
return
0
;
}
}
20231012/rozmowa.cpp
View file @
2da5e37b
...
@@ -4,12 +4,11 @@ using namespace std;
...
@@ -4,12 +4,11 @@ using namespace std;
int
main
()
int
main
()
{
{
double
a
,
b
;
cout
<<
"Jak masz na imie?"
<<
endl
;
cout
<<
"Podaj pierwszy bok: "
;
string
imie
;
cin
>>
a
;
cin
>>
imie
;
cout
<<
"Podaj drugi bok: "
;
cout
<<
"Witaj "
<<
imie
<<
endl
;
cin
>>
b
;
cout
<<
imie
<<
endl
;
cout
<<
"Pole prostokata: "
<<
a
*
b
<<
endl
;
cout
<<
"Obwod prostokata: "
<<
2
*
a
+
2
*
b
<<
endl
;
return
0
;
return
0
;
}
}
20231019/losowanie.cpp
0 → 100644
View file @
2da5e37b
#include <iostream>
#include <cstdlib>
#include <ctime>
using
namespace
std
;
int
main
()
{
srand
(
time
(
nullptr
));
int
x
=
rand
();
int
y
=
rand
();
cout
<<
"Wylosowane liczby: "
<<
x
<<
", "
<<
y
<<
endl
;
return
0
;
}
20231019/sprawdz_wiek.cpp
0 → 100644
View file @
2da5e37b
#include <iostream>
using
namespace
std
;
/* Zapytaj czlowieka ile ma lat.
Jesli jest pelnoletni, to napisz, ze moze kupic piwo.
Jesli nie, to napisz za ile lat bedzie pelnoletni.
*/
int
main
()
{
cout
<<
"Ile masz lat? "
;
int
wiek
;
cin
>>
wiek
;
if
(
wiek
<
18
)
{
cout
<<
"Jestes osoba niepelnoletnia"
<<
endl
;
cout
<<
"Osiemnastke bedziesz miec za "
<<
18
-
wiek
<<
" lat."
<<
endl
;
}
else
{
cout
<<
"Jestes dorosly/a i rob co chcesz."
;
}
return
0
;
}
20231019/zagadka.cpp
0 → 100644
View file @
2da5e37b
#include <iostream>
#include <cstdlib>
#include <ctime>
using
namespace
std
;
int
main
()
{
srand
(
time
(
nullptr
));
int
x
=
rand
()
%
10
;
int
y
=
rand
()
%
10
;
cout
<<
"Ile to jest "
<<
x
<<
" razy "
<<
y
<<
" ?"
<<
endl
;
int
odpowiedz
;
cin
>>
odpowiedz
;
if
(
odpowiedz
==
x
*
y
)
{
cout
<<
"Super, jestes madry, bo wiesz jak mnozyc liczby"
<<
endl
;
}
else
{
cout
<<
"Niestety, zla odpowiedz"
<<
endl
;
cout
<<
"Wroc do podstawowki!"
<<
endl
;
}
return
0
;
}
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