Code not accepted

#include
using namespace std;

int main(){
int n;
cin>>n;
if(n>0){
for(int i=1;i<=n;i++){
for(int j=1;j<=n-i+1;j++){
cout<<j;
}
if(i>1){
for(int k=1;k<=2*(i-1)+1;k++){
cout<<"*";
}}cout<<endl;
}}
}
why the above code for this program is not being accepted.

provide 1 space after printing each character