fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n ;
  6. cin>> n;
  7.  
  8. for(int i =0 ; i < n ; i++){
  9. for(int j =0 ; j < n ; j++){
  10. cout << "0";
  11. }
  12. cout << endl;
  13. }
  14. cout <<endl;
  15.  
  16. for(int i =0 ; i < n ; i++){
  17. for(int j = 0 ; j <= i; j++){
  18. cout << "0";
  19. }
  20. cout << endl;
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5288KB
stdin
5
stdout
00000
00000
00000
00000
00000

0
00
000
0000
00000