-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTari Bintang.cpp
63 lines (55 loc) · 949 Bytes
/
Tari Bintang.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <iostream>
#define EQ ==
using namespace std;
int main()
{
//VARIABEL
double x,y,p;
double jenistari, jumlahbaris;
cout << "MASUKKAN JENIS TARI:" << endl << "1. Tari Kotak" << endl << "2. Tari Tambah" << endl << "3. Tari Kurang"
<< endl << "4. Tari Segitiga" << endl <<"5. Tari Diamond" << endl;
cin >> jenistari;
cout << "MASUKKAN JUMLAH BARIS" << endl;
cin >> jumlahbaris;
if (jenistari<2 and jenistari>0)
{
for (x=0;x<jumlahbaris;x++)
{
for(y=0;y<jumlahbaris;y++)
{
cout << "*";
}
cout << endl;
}
}
if (jenistari<3 and jenistari>1)
{
p=1;
for (x=0;x<jumlahbaris;x++)
{
// Pengulangan
for(y=0;y<p;y++)
{
cout << "*";
}
p=p+1;
cout << endl;
}
}
if (jenistari<4 and jenistari>2)
{
p=jumlahbaris;
for (x=0;x<jumlahbaris;x++)
{
// Pengulangan
for(y=0;y<p;y++)
{
cout << "*";
}
p=p-1;
cout << endl;
}
}
return 0;
getchar();
}