Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Khisby Al Ghofari, 06.2017.1.06852, Kelas B
- #include <iostream>
- using namespace std;
- int main(){
- int n;
- cout << "Masukkan angka: ";
- cin >> n;
- for(int j=1;j<=n;j++){
- int angka=1;
- for(int i=1;i<=j;i++){
- cout<<angka;
- angka++;
- }
- cout<<"\n";
- }
- for(int j=1;j<n;j++){
- int angka=1;
- for(int i=n-j-1;i>=0;i--){
- cout<<angka;
- angka++;
- }
- cout<<"\n";
- }
- }
Add Comment
Please, Sign In to add comment