Skip to content

Instantly share code, notes, and snippets.

@m1irka
Created October 24, 2024 04:12
Show Gist options
  • Select an option

  • Save m1irka/be6110eadb463fcf1fc92965fe0af448 to your computer and use it in GitHub Desktop.

Select an option

Save m1irka/be6110eadb463fcf1fc92965fe0af448 to your computer and use it in GitHub Desktop.
#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