zoho strange pattern

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; int main() { int n,a[100],a1[100]; cin>>n; int i,k=0,k1,j; a[0]=1; cout<<a[0]<<endl; k++; int ct; for(i=1;i<n;i++) { k1=0; for(j=0;j<k;j++) { ct=1; if(j+1<k) { while(a[j]==a[j+1]&&j<k) { j++; ct++; } } if(j>=k) j=k-1; cout<<ct<<" "<<a[j]<<" "; a1[k1]=ct; k1++; a1[k1]=a[j]; k1++; } cout<<endl; k=k1; for(j=0;j<k;j++) a[j]=a1[j]; } return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines