Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5.  
  6. {
  7.  
  8. int baris3,kolom3,n;
  9. cout << "masukkan tingkatan = "; cin >> n; cout<<endl;
  10. for(baris3=1;baris3<=n;baris3++)
  11. {
  12. int jumlah=0;
  13. for(kolom3=n;kolom3>=baris3;kolom3-=1)
  14. {
  15. cout<<kolom3;
  16. jumlah+=kolom3;
  17. if(kolom3>=baris3)
  18. {
  19. cout<<"+"<<"="<<jumlah;;
  20. }
  21. }
  22. cout<<endl;
  23. }
  24.  
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement