Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void task0() {
- int a = 55;
- int b = 43;
- int c, d;
- c = a++;
- d = ++b;
- cout << c << " " << d << endl;
- }
- void task1() {
- for (int k = 0; k < 5; k++) {
- for (int n = 0; n <= k; n++) {
- //if(n <= k)
- cout << "*";
- }
- cout << endl;
- }
- }
- int n = 0;
- void task2() {
- int k = 0;
- int n = 0;
- while (k < 5) {
- n = 0;
- while(n <= k) {
- //if(n <= k)
- cout << "*";
- n++;
- }
- cout << endl;
- k++;
- }
- }
- void task3() {
- int n = 0;
- do {
- n++;
- if (!(n % 3)) continue;
- if (!(n % 4)) continue;
- if (!(n % 5)) continue;
- if (!(n % 23)) continue;
- cout << n << " ";
- } while (n <= 500);
- cout << endl;
- }
- void task4() {
- for (int k = 0; k < 7; k++) {
- for (int n = 0; n < 7; n++) {
- if ((k == n) || ((k+n) == 6)
- || (k == 3) || (n == 3))
- cout << "* ";
- else
- cout << " ";
- }
- cout << endl;
- }
- }
- void task5() {
- for (int y = 3; y >= -3; y--) {
- for (int x = -3; x <= 3; x++) {
- if ((x == y) || (x == -y)
- || (y == 0) || (x == 0))
- cout << "* ";
- else
- cout << " ";
- }
- cout << endl;
- }
- }
- void test_array() {
- const int size = 8;
- int x[size]{0, 1,2,3,4,5,6,7};
- /*
- const char* str1 = "dasdasdasd";
- char str[100]{ 's', 'd' };
- string str;
- */
- /*
- x[0] = 1;
- x[1] = 2;
- x[2] = 4;
- x[3] = 7;
- */
- for (int n = 0; n < size; n++)
- cin >> x[n] ;
- for(int n = 0; n < size; n++)
- cout << x[n] << " ";
- cout << endl;
- }
- int main() {
- test_array();
- }
Advertisement
Add Comment
Please, Sign In to add comment