#include
usingnamespace std;
int main() {
int n;
cin >> n;
int i, j;
for (i = 1; i <= n; i++) {
for (j = 1; j <= (2 * n - 1); j++) {
if (j <= i)
cout << j + " ";
elseif ((i + j) >= 2 * n)
cout << (2 * n - j) + " ";
else
cout << " ";
}
cout << endl;
}
return 0;
}
1:9: error: expected "FILENAME" or <FILENAME>
#include
^
13:19: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
cout << j + " ";
~~^~~~~
13:19: note: use array indexing to silence this warning
16:29: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
cout << (2 * n - j) + " ";
~~~~~~~~~~~~^~~~~
16:29: note: use array indexing to silence this warning