Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int W;
- int K;
- int main()
- {
- cout << "Podaj liczbe wierszy: "; cin >> W;
- cout << "Podaj liczbe kolumn: "; cin >> K;
- cout << endl;
- cout << "1." << endl;
- for (int i = 0; i < W; ++i) {
- for (int j = 0; j < K; ++j) {
- if (i == 0 || i % 2 == 0) {
- cout << "x";
- }
- else {
- cout << ".";
- }
- } cout << endl;
- }
- cout << endl;
- cout << "2." << endl;
- for (int i = 0; i < W; ++i) {
- for (int j = 0; j < K; ++j) {
- cout << "x.";
- } cout << endl;
- }
- cout << endl;;
- cout << "3." << endl;
- for (int i = 0; i < W; ++i) {
- for (int j = 0; j < K; ++j) {
- if (i <= j) {
- cout << "x";
- }
- else {
- cout << ".";
- }
- }cout << endl;
- }
- cout << endl;
- cout << "4." << endl;
- cout << endl;
- cout << "5." << endl;
- for (int i = 0; i < W; ++i) {
- for (int j = 0; j < K; ++j) {
- if (i == 0 || i % 2 == 0) {
- cout << "x.";
- }
- else {
- cout << ".x";
- }
- } cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement