3 solutions

  • 1
    @ 2026-3-22 10:45:25

    #include using namespace std;

    int main() { char a; cin >> a; int b = 4; int c = 4; for (int i = 1; i <= 3; i++) { for (int x = 1; x <= 5; x++) { if (i + x >= b && i + x <= c) { cout << a; } else { cout << " "; } } cout << endl; c = c + 2; } int e = 8; int f = 6; for (int n = 4; n <= 5; n++) { for (int y = 1; y <= 5; y++) { if (n + y >= f && n + y <= e) { cout << a; } else { cout << " "; } } cout << endl; f = f + 2; } return 0; }

    • -3
      @ 2026-1-7 13:34:08

      #include <bits/stdc++.h> using namespace std;

      int main() { char a; cin >> a; cout << " " << a << '\n' << " " << a << a << a << '\n' << a << a << a << a << a << '\n' << " " << a << a << a << '\n' << " " << a; return 0; }

      • -3
        @ 2025-10-31 14:31:07
        #include<iostream>
        using namespace std;
        int main(){
            char a;
            cin>>a;
            int b = 4;
            int c = 4;
            for(int i = 1;i<=3;i++){
                for(int x = 1;x<=5;x++){
                    if(i+x>=b&&i+x<=c){
                        cout<<a;
                    }else{
                        cout<<" ";
                    }
                }
                cout<<endl;
                c = c+2;
            }
            int e = 8;
            int f = 6;
            for(int n = 4;n<=5;n++){
                for(int y = 1;y<=5;y++){
                    if(n + y >= f && n+y <= e){
                       cout<<a; 
                    }else{
                        cout<<" ";
                    }
                }
               cout<<endl;
                f = f+2; 
            }
            return 0;
        }
        
        • 1

        Information

        ID
        493
        Time
        1000ms
        Memory
        128MiB
        Difficulty
        3
        Tags
        # Submissions
        193
        Accepted
        98
        Uploaded By