fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. for (int k=1;k<=3;k++){
  6. for (int i = 0;i < 3;i++) {
  7. for (int j = 0;j < 3;j++) {
  8. if ( (i==j)||(k%2==1) == (i < j) ) {
  9. cout << k;
  10. }
  11. }
  12. cout << "\n";
  13. }
  14. }
  15. return 0;
  16. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
111
11
1
2
22
222
333
33
3