~cpp #include <iostream> using namespace std; int main() { int ar[10][10]={{0}}; for (int k = 0; k < 10 - 1; k++) cout << " "; ar[0][0] = 1; cout << ar[0][0] << endl; for (int i = 1; i < 10; i++) { for (int k = 0; k < 10 - 1 - i; k++) cout << " "; for (int j = 0; j < i + 1; j++) { if (j == 0) ar[i][j] = 1; else ar[i][j] = (ar[i-1][j] == ar[i-1][j-1]) ? 0 : 1; cout << ar[i][j] << " "; } cout << "\n"; } return 0; }