Advertisement
STANAANDREY

pclab3 custom2

Oct 12th, 2022 (edited)
721
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.   int n;
  5.   printf("n="); scanf("%d", &n);
  6.   for (int i = 1; i <= (n + 1) / 2; i++) {
  7.     for (int j = 1; j <= n; j++) {
  8.       if (j == i || j == n - i + 1) {
  9.         printf("*");
  10.       } else {
  11.         printf(" ");
  12.       }
  13.     }
  14.     puts("");
  15.   }
  16.   return 0;
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement