fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main() {
  6. int length;
  7. cout<<"length: ";
  8. cin>> length;
  9. char symbol;
  10. cout<< "symbol: ";
  11. cin>> symbol;
  12. cout<<endl;
  13.  
  14. for(int i=1;i<=length; i++){
  15. for(int j=1; j<=i; j++){
  16. cout << symbol;
  17. }
  18. cout<<endl;
  19. }
  20. cout<<endl<<endl;
  21. for(int i=length;i>=1; i--){
  22. for(int j=1; j<=i; j++){
  23. cout << symbol;
  24. }
  25. cout<<endl;
  26. }
  27. return 0;
  28. }
Success #stdin #stdout 0s 5324KB
stdin
5 @
stdout
length: symbol: 
@
@@
@@@
@@@@
@@@@@


@@@@@
@@@@
@@@
@@
@