Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 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=8;kolom3>=baris3;kolom3-=1)
  14. {
  15. cout<<kolom3;
  16. jumlah+=kolom3;
  17. if(kolom3>=1)
  18. {
  19. cout<<"+";
  20. }
  21. else{
  22.  
  23. cout<<"="<<jumlah;
  24. }
  25. }
  26. cout<<endl;
  27. }
  28.  
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement