Advertisement
a53

Desen_Clepsidra

a53
May 26th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n;
  7. cin>>n;
  8. int k;
  9. for(int i=1;i<=n;++i)
  10. {
  11. k=i-1;
  12. for(int j=1;j<=k;++j)
  13. cout<<"#";
  14. for(int j=k+1;j<=n;++j)
  15. cout<<"*";
  16. for(int j=k+1;j<n;++j)
  17. cout<<"*";
  18. for(int j=1;j<=k;++j)
  19. cout<<"#";
  20. cout<<"\n";
  21. }
  22. for(int i=1;i<n;++i)
  23. {
  24. k=n-i;
  25. for(int j=1;j<k;++j)
  26. cout<<"#";
  27. for(int j=1;j<=2*i+1;++j)
  28. cout<<"*";
  29. for(int j=1;j<k;++j)
  30. cout<<"#";
  31. cout<<"\n";
  32. }
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement