Advertisement
STANAANDREY

pclab3 4

Oct 12th, 2022 (edited)
594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 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; i++) {
  7.     for (int j = 1; j <= n; j++) {
  8.       if (j == 1 || i == j || j == n) {
  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