• Source
    1. //Dibuat oleh MOSYAN-ORGANIZER
    2. #include <iostream>
    3.  
    4. int main (){
    5. int th;
    6. std::cout <<"Masukkan Nilai (Menentukan Tinggi H) : ";
    7. std::cin >> th;
    8.  
    9. for(int a=1; a<=th; a++)
    10. {
    11. for(int i=0; i<th; i++)
    12. {
    13. if(i<1 || i == th-1)
    14. {
    15. std::cout<<"#";
    16. }
    17. else if(a == (th/2)+1)
    18. {
    19. std::cout<<"#";
    20. }
    21. else
    22. {
    23. std::cout<<" ";
    24. }
    25. }
    26. std::cout<<std::endl;
    27. }
    28. }