Jawaban #6 Segitiga

// -------------------------------------------------------
// Author : Asadullohil Ghalib - gadzata@gmail.com
// -------------------------------------------------------
#include <iostream>
using namespace std;

int main() {

	int jmlsegitiga, i,j,k;
	int a[1000];

	cout << "Masukkan Jumlah Segitiga : "; cin >> jmlsegitiga;

	for(i=1;i<=jmlsegitiga;i++){
		cout << "Masukkan Segitiga ke - " << i << " "; cin >> a[i];
	}

	for(i=1;i<=jmlsegitiga;i++){
		for(j=a[i];j>=1;j--){
			for(k=1;k<=j;k++){
				cout << "*";
			}
			cout << endl;
		}
		cout << endl;
	}

}

One thought on “Jawaban #6 Segitiga

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s