Задание № 3. Ваш говнокод, господин Д'Артаньян
#include
using namespace std;
int main()
{
int n, m;
cout << "n, m?.. ";
cin >> n >> m;
for (int j = 0; j < n; j++)
{
cout << '*';
}
cout << endl;
for (int j = 1; j < m; j++)
{
cout << '*';
for (int k = 1; k < n - 1; k++)
{
cout << ' ';
}
cout << '*' << endl;
}
for (int j = 0; j < n; j++)
{
cout << '*';
}
cin.get();
cin.get();
return 0;
}
#include
using namespace std;
int main() {
int n;
cout << "n?.. ";
cin >> n;
for (int k = 0; k < n; k++, cout << endl)
for (int l = 0; l < n; l++)
if (k == l || k + l == n - 1) cout << '*';
else cout << ' ';
cin.get();
cin.get();
return 0;
}