Created
October 24, 2024 04:12
-
-
Save m1irka/be6110eadb463fcf1fc92965fe0af448 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| int rows, cols; | |
| cout << "Enter rows: "; | |
| cin >> rows; | |
| cout << "Enter cols: "; | |
| cin >> cols; | |
| if (rows != cols) | |
| { | |
| for (int i = 0; i < rows; i++) | |
| { | |
| for (int j = 0; j < cols; j++) | |
| { | |
| if ((i == 2) || (j == 1)) | |
| { | |
| cout << 1 << " "; | |
| } | |
| else | |
| { | |
| cout << 0 << " "; | |
| } | |
| } | |
| cout << endl; | |
| } | |
| } | |
| else | |
| { | |
| cout << "Error. Good bye ;p"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment