Facebook
From Gregorio Manoeroe, 2 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 69
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.         int inputn, x, y, z;
  6.        
  7.         cout << "Masukkan nilai n = ";
  8.         cin >> inputn;
  9.         cout << endl;
  10.        
  11.         for(x = 0; x < inputn; x++){
  12.                 for(y = 0; y < inputn - x; y++){
  13.                         cout << " ";
  14.                 }
  15.                 for(z = 0; z <= x; z++){
  16.                         cout << "* ";
  17.                 }
  18.                 cout << endl;
  19.         }
  20.         return 0;
  21. }