Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void x(int h);
- int main()
- {
- int h;
- scanf("%d", &h);
- x(h + 1);
- return EXIT_SUCCESS;
- }
- void x(int h)
- {
- int tabl[h][h];
- for (int x = 0; x < h; ++x) {
- for (int y = 0; y < h; y++)
- {
- if(y == x || y == ( h - x ))
- {
- tabl[x][y] = '*';
- }
- else{
- tabl[x][y] = ' ';
- }
- }
- }
- for (int x = 1; x < h; ++x) {
- for (int y = 0; y < h; ++y) {
- printf("%c", tabl[x][y]);
- }
- printf("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement