Advertisement
elektryk798

Trojkat

Nov 9th, 2016
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include<windows.h>
  4.  
  5. int main()
  6. {
  7.     int ile,i,j,l,szer,wys;
  8.     scanf("%d",&ile);
  9.     system("cls");
  10.     CONSOLE_SCREEN_BUFFER_INFO csbi;
  11.     GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
  12.     szer = csbi.srWindow.Right - csbi.srWindow.Left + 1;
  13.     printf("%d\n",szer);
  14.     //wys = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
  15.     l=(szer-ile)/2;
  16.     for(i=0;i<ile;i+=2)
  17.     {
  18.         for(j=((ile-i)/2)+l;j>0;j--)
  19.             printf(" ");
  20.         for (j=i;j>=0;j--)
  21.             printf("*");
  22.         printf("\n");
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement