Advertisement
DominikPasiut

Untitled

Oct 31st, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.68 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3.  
  4. {
  5.     int bokA, bokB,i,j;
  6.  
  7.     printf("podaj dlugosc boku a\n");
  8.     scanf("%d", &bokA);
  9.     printf("podaj dlugosc boku b\n");
  10.     scanf("%d",&bokB);
  11.  
  12.     if(bokA<1 || bokB<1)
  13.         printf("Za krotki bok");
  14.     else
  15.         for(i=0;i<bokA;i++)
  16.         {
  17.             printf("\n");
  18.             for(j=0;j<bokB;j++)
  19.             {
  20.                 if(i>0 && i<bokA-1)
  21.                 {
  22.                     if(j>0 && j<bokB-1)
  23.                         printf(" ");
  24.                     else
  25.                     printf(" *");
  26.                 }
  27.                 else
  28.                     printf(" *");
  29.             }
  30.         }
  31.  
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement