Advertisement
Guest User

Untitled

a guest
May 16th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7.  
  8. int main() {
  9. int n, m;
  10. cin >> n >> m;
  11. for(int i = 0; i < n; i++) {
  12. if (i == 0 || i < n / 2) {
  13. for(int j = 0; j < n; j++) {
  14. cout << ' ';
  15. }
  16. cout << endl;
  17. }
  18. else {
  19. for(int j = 0; j < n; j++) {
  20. if(j == i || j == n - i - 1)
  21. cout << '*';
  22. else cout << ' ';
  23. }
  24. cout << endl;
  25. }
  26. }
  27. for(int i = 0; i < n; i++) {
  28. if (i == 0 || i == n - 1) {
  29. for(int j = 0; j < n; j++) {
  30. cout << '*';
  31. }
  32. cout << endl;
  33. }
  34. else {
  35. cout << '*';
  36. for(int j = 0; j < n - 2; j++) {
  37. if(j == i - 1 || j == n - i - 2)
  38. cout << '*';
  39. else cout << ' ';
  40. }
  41. cout << '*' << endl;
  42. }
  43. }
  44.  
  45. system("pause");
  46. return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement