-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathASCII Flower
More file actions
46 lines (43 loc) · 917 Bytes
/
Copy pathASCII Flower
File metadata and controls
46 lines (43 loc) · 917 Bytes
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
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main(){
int r;
int c;
scanf("%d %d",&r,&c);
// your code goes here
int n=0,m,i,j;
char a[3*r][5*c];
for(i=0;i<r;i++,n=n+3){
for(j=0;j<c;j++,m=m+5){
// printf("m%d i%d",m,i);
a[0+n][0+m]='.';
a[0+n][1+m]='.';
a[0+n][2+m]='O';
a[0+n][3+m]='.';
a[0+n][4+m]='.';
a[1+n][0+m]='O';
a[1+n][1+m]='.';
a[1+n][2+m]='o';
a[1+n][3+m]='.';
a[1+n][4+m]='O';
a[2+n][0+m]='.';
a[2+n][1+m]='.';
a[2+n][2+m]='O';
a[2+n][3+m]='.';
a[2+n][4+m]='.';
}
m=0;
}
for(i=0;i<r*3;i++){
for(j=0;j<c*5;j++){
printf("%c",a[i][j]);
}
printf("\n");
}
return 0;
}