document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <iostream>
  2. #include <conio.h>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a,b,x;
  7.     cout<<"\\t\\tFORMASI KOTAK ANGKA"<<"\\n";
  8.     cout<<"\\t=================================="<<"\\n";
  9.     bil:
  10.     cout<<"Inputkan Angka = ";
  11.     cin>>x;
  12.     cout<<"\\n";
  13.  
  14.     if(x>0){
  15.         for(a=x;a>=1;a--){
  16.             for(b=a;b>1;b--){
  17.                 if (a==x||b==a)
  18.                     cout<<b<<" ";
  19.                 else
  20.                     cout<<"  ";
  21.             }
  22.             for(b=1;b<=x-a+1;b++){
  23.                 if(a==1||b==x-a+1)
  24.                     cout<<b<<" ";
  25.                 else
  26.                     cout<<"  ";
  27.             }
  28.             cout<<endl;
  29.         }
  30.     }
  31.     else {
  32.         cout<<"Input Salah !!!"<<endl;
  33.         goto bil;
  34.     }
  35.     return 0;
  36. }
');