-
Notifications
You must be signed in to change notification settings - Fork 0
/
t8.c
49 lines (47 loc) · 893 Bytes
/
t8.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <stdio.h>
#include <stdlib.h>
int main() {
int i=0;
int arr[3];
char new;
while(new!='\n'){
scanf("%d%c", &arr[i], &new);
i++;
}
int x=arr[0];
int y=arr[1];
int n=arr[2];
int k=0;
while(k<y)
{
if (k==0){
char a[x+1];
for(int j = 0; j < x; j++)
{
a[j] = '#';
}
printf("%s\n", a);
}
else if (k==y-1)
{
char a[x+1];
for(int j = 0;j < x; j++)
{
a[j] = '#';
}
printf("%s\n", a);
}
else
{
char a[x+1];
a[0] = '#';
a[x-1] = a[0];
for(int j = 1; j<x-1; j++)
{
a[j] = '.';
}
printf("%s\n", a);
}
k++;
}
}