-
Notifications
You must be signed in to change notification settings - Fork 14
/
노현서 2주차 과제
131 lines (99 loc) · 2 KB
/
노현서 2주차 과제
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// Baekjoon 10869
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main(void) {
int A, B;
printf("A를 입력하시오. ");
scanf("%d", &A);
printf("B를 입력하시오. ");
scanf("%d", &B);
printf("%d\n", A + B);
printf("%d\n", A - B);
printf("%d\n", A * B);
printf("%d\n", A / B);
printf("%d\n", A % B);
return 0;
}
// Baekjoon 1330
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main(void) {
int A, B;
printf("A를 입력하시오. ");
scanf("%d", &A);
printf("B를 입력하시오. ");
scanf("%d", &B);
if (A > B) {
printf("'>'");
}
else if (A < B) {
printf("'<'");
}
else {
printf("'='");
}
return 0;
}
// Baekjoon 2753
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main(void) {
int Year;
printf("년도를 입력하시오. ");
scanf("%d", &Year);
if (Year % 4 == 0 && Year % 100!= 0 || Year % 400 == 0) {
printf("1");
}
else {
printf("0");
}
return 0;
}
// Baekjoon 14681
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main(void) {
int X, Y;
printf("X값을 입력하시오. ");
scanf("%d", &X);
printf("Y값을 입력하시오. ");
scanf("%d", &Y);
if (X > 0 && Y > 0) {
printf("1");
}
else if (X < 0 && Y > 0) {
printf("2");
}
else if (X < 0 && Y < 0) {
printf("3");
}
else if (X > 0 && Y < 0) {
printf("4");
}
return 0;
}
// Baekjoon 2884
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main(void) {
int H, M;
printf("시(hour)를 입력하시오. ");
scanf("%d", &H);
printf("분(minute)을 입력하시오. ");
scanf("%d", &M);
if (M >= 45) {
M = M - 45;
}
else {
if (H > 0) {
M = M + 15;
H = H - 1;
}
else {
M = M + 15;
H = 23;
}
}
printf("%d시 %d분", H, M);
return 0;
}