Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void drawFullLine(int n) {
- for (int i = 1; i <= n; i++) {
- printf("*");
- }
- printf("\n");
- }
- void drawEmptyLine(int n) {
- printf("*");
- for (int i = 2; i < n; i++) {
- printf(" ");
- }
- printf("*\n");
- }
- void drawEmptySection(int n) {
- for (int i = 2; i <= n; i++) {
- drawEmptyLine(n * 2 + 1);
- }
- }
- int main(void) {
- int n;
- printf("n="); scanf("%d", &n);
- drawFullLine(n);
- drawEmptySection(n / 2);
- drawFullLine(n);
- drawEmptySection(n / 2);
- drawFullLine(n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement