-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheccentric.c
50 lines (41 loc) · 1.04 KB
/
eccentric.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
49
50
#include <stdio.h>
/* Only change any of these 4 values */
#define V0 0
#define V1 -1
#define V2 0
#define V3 0
// DO NOT EDIT BELOW THIS LINE
#ifndef TEST
int main(void) {
int a;
char *s;
/* This is a print statement. Notice the little 'f' at the end!
It might be worthwhile to look up how printf works for your future
debugging needs... */
printf("Berkeley eccentrics:\n====================\n");
/* for loop */
for (a=0; a<V0; a++) {
printf("Happy ");
}
printf("\n");
/* switch statement */
switch (V1) {
case 0: printf("Yoshua\n");
case 1: printf("Triangle Man\n"); break;
case 2: printf("Chinese Erhu Guy\n");
case 3: printf("Yoshua\n"); break;
case 4: printf("Dr. Jokemon\n"); break;
case 5: printf("Hat Lady\n");
default: printf("I don't know these people!\n");
}
/* ternary operator */
s = (V3==3) ? "Go" : "Boo";
/* if statement */
if (V2) {
printf("\n%s BEARS!\n", s);
} else {
printf("\n%s CARDINAL!\n", s);
}
return 0;
}
#endif