Skip to content

Instantly share code, notes, and snippets.

@unaipme
Created October 9, 2017 14:58
Show Gist options
  • Save unaipme/3b1b7ba9750099ec5cdd610d85c13aae to your computer and use it in GitHub Desktop.
Save unaipme/3b1b7ba9750099ec5cdd610d85c13aae to your computer and use it in GitHub Desktop.
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main(void) {
char str[128];
int n, i, j, topeX;
printf("Sartu I letraren tamaina: ");
fgets(str, 128, stdin);
sscanf(str, "%d", &n);
topeX = (n % 2) ? n : n + 1;
for (i = 0; i < topeX; i++) printf("*");
printf("\n");
for (i = 0; i < n - 2; i++) {
for (j = 0; j < n / 2; j++) printf(" ");
printf("*\n");
}
for (i = 0; i < topeX; i++) printf("*");
printf("\n");
getchar();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment