Advertisement
STANAANDREY

pclab3 3

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