#include <iostream>
using namespace std;
int main() {
int n=8;
for(int i=0;i<n;i++){
//spaces : n-i-1
for(int j=0;j<n-i-1;j++){
cout<<" ";
}
//nums1:i+1
for(int j=1;j<=i+1;j++){
cout<<j;
}
//nums2
for(int j=i;j>0;j--){
cout<<j;
}
cout<<endl;
}
return 0;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: