int length = 0;scanf( "%d", &length );for( int i=0, j=1; i<j; i==j-1&&j<length?i=0,j+=2:++i ){printf( "%s", i==j-1 ? "*\n" : "*" );}