We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0035191 commit 1c9a35dCopy full SHA for 1c9a35d
Pattern00012.c
@@ -0,0 +1,40 @@
1
+/*
2
+
3
+*********
4
+**** ****
5
+*** ***
6
+** **
7
+* *
8
9
+*/
10
11
+#include <stdio.h>
12
+int main()
13
+{
14
+ // My
15
+ // Approach
16
+ for (int i = 1; i <= 5; i++)
17
+ {
18
+ for (int j = 1; j <= 9; j++)
19
20
+ if (j >= 7 - i && j <= i + 3)
21
+ printf(" ");
22
+ else
23
+ printf("*");
24
+ }
25
+ printf("\n");
26
27
+ // Different
28
29
+ for (int a = 1; a <= 5; a++)
30
31
+ for (int b = 1; b <= 9; b++)
32
33
+ if (b <= 6 - a || b >= 4 + a)
34
35
36
37
38
39
40
+}
0 commit comments