c2
This commit is contained in:
parent
0d75f30a49
commit
4744ebb565
69 changed files with 7 additions and 5 deletions
17
1sem/programming basics/z04/10.cpp
Normal file
17
1sem/programming basics/z04/10.cpp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// pb_z4_10.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int a;
|
||||
cin >> a;
|
||||
cout << a << endl;
|
||||
do {
|
||||
int b;
|
||||
cin >> b;
|
||||
if (a > b) break;
|
||||
cout << b << endl;
|
||||
a = b;
|
||||
} while (true);
|
||||
}
|
||||
20
1sem/programming basics/z04/11.cpp
Normal file
20
1sem/programming basics/z04/11.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// pb_z4_11.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
void print_diag(int s) {
|
||||
for (int i = 0; i < s; i++) {
|
||||
for (int j = 0; j < i; j++) {
|
||||
cout << " ";
|
||||
}
|
||||
cout << "*" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
int a;
|
||||
cout << "a >>";
|
||||
cin >> a;
|
||||
print_diag(a);
|
||||
}
|
||||
22
1sem/programming basics/z04/12.cpp
Normal file
22
1sem/programming basics/z04/12.cpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// pb_z4_12.cpp
|
||||
// Горбацевич Андрей
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
void print_rect(int x, int y, int sx, int sy) {
|
||||
cout << "<<< printing rect >>>" << endl;
|
||||
for (int i = 0; i < y; i++) cout << endl;
|
||||
for (int i = 0; i < sy; i++) {
|
||||
for (int j = 0; j < x; j++) cout << " ";
|
||||
for (int j = 0; j < sx; j++) cout << "@";
|
||||
cout << endl;
|
||||
}
|
||||
cout << "<<<done printing rect>>>" << endl;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int x, y, sx, sy;
|
||||
cout << "x, y, sx, sy >>";
|
||||
cin >> x >> y >> sx >> sy;
|
||||
print_rect(x, y, sx, sy);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue