Skip to main content

0-1 Pattern

 /* @ToDo 



0-1 Pattern
    1
    0   1
    0   1   0
    1   0   1   0
    1   0   1   0   1

*/


#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;
    int sign = 1;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=i;j++){
            cout<<"\t"<<sign;
            sign = !sign;
        }
        cout<<endl;
    }
    return 0;
}

Comments

Subscribe to Get's Answer by Email