#include <iostream>
using namespace std;
int main(){
int n;
cout << "Masukan panjang pola: ";
cin >> n;
cout << endl;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= i; j++){
cout << "*" ;
}
cout << endl ;
}
cout << endl;
for(int i = 1; i <= n; i++){
for(int j = n; j >= i; j--){
cout << "*" ;
}
cout << endl ;
}
cin.get);
return 0;
}
using namespace std;
int main(){
int n;
cout << "Masukan panjang pola: ";
cin >> n;
cout << endl;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= i; j++){
cout << "*" ;
}
cout << endl ;
}
cout << endl;
for(int i = 1; i <= n; i++){
for(int j = n; j >= i; j--){
cout << "*" ;
}
cout << endl ;
}
cin.get);
return 0;
}
Tidak ada komentar:
Posting Komentar