Skip to main content

Zig Zag Pattern

 /* @ToDo 


   Zig Zag Pattern
        *               *           
    *       *       *       *       
*               *               *   

   
*/


#include <iostream>
using namespace std;

int main(){
     #ifndef ONLINE_JUDGE
        freopen("../asset/input.txt","r",stdin);
        freopen("../asset/output.txt","w",stdout);
    #endif
    // Code here!!

    int ncin>>n;
    for(int i=1;i<=3;i++){
        for(int j=1;j<=n;j++){
            if(((i+j)%4 == 0) || (i==2 && j%4 == 0))
                cout<<"*\t";
            else cout<<"\t";
        }
        cout<<endl;
    }

    return 0;
}

Comments

Subscribe to Get's Answer by Email