Advertisement
Mauriciocaradenepe

rombo 2

Jun 5th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. void rombo2() {
  4. int l;
  5. do
  6. {
  7. cout << "Ingrese numero entre los valores de 1 y 11: ";
  8. cin >> l;
  9. } while (l<0||l>11);
  10. for (int i = 1; i <= l; i++)
  11. {
  12. for (int k = l - 1; k >= i; k--)
  13. {
  14. cout << " ";
  15. }
  16. for (int j = 1; j <= i; j++)
  17. {
  18. cout << " * ";
  19.  
  20. }
  21. cout << endl;
  22. }
  23. for (int i = 1; i <= l; i++)
  24. {
  25. for (int k = 1; k <= i; k++)
  26. {
  27. cout << " ";
  28. }
  29. for (int j = l-1; j >= i; j--)
  30. {
  31. cout << " * ";
  32.  
  33. }
  34.  
  35.  
  36. cout << endl;
  37. }
  38. cin.get();
  39. }
  40. int main() {
  41. rombo2();
  42. cin.get();
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement