Advertisement
NoExisteLink

PROGRA30-05-2014(2)

May 30th, 2014
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. using namespace std;
  4.  
  5. void dibuja(int x, int y){
  6. int k;
  7. for(k=1;k<=y;k++){cout<<" ";}
  8. for(k=1;k<=2*y-1;k++){
  9. cout<<"*";
  10. if(k<2*y-1){cout<<" ";}
  11. }
  12. }
  13.  
  14. void dibuja2(int x, int y){
  15. int k;
  16. for(k=1;k<=y;k++){cout<<" ";}
  17. for(k=1;k<=2*y-1;k++){
  18. cout<<"*";
  19. if(k<2*y-1){cout<<" ";}
  20. }
  21. }
  22. int main(){
  23. int a,b;
  24. cin>>a;
  25. for(b=0;b<=a;b++){
  26. cout<<endl;
  27. dibuja(a,b);dibuja2(a,b);
  28. cout<<endl;}
  29. for(b=a-1;b>=1;b--){
  30. cout<<endl;
  31. dibuja(a,b);dibuja2(a,b);
  32. cout<<endl;
  33. }
  34. _getch();
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement