Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

전해일 / 6주차 / 3문제 #13

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Haeil/6주차/2525.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <stdio.h>

int main() {
int h;
int m;
int time;
printf("");
scanf("%d %d", &h, &m);
printf("");
scanf("%d", &time);
m += time;
h += m / 60;
m %= 60;
if (h >= 24) {
h -= 24;

}
printf("%d %d", h , m);
return 0;
}
21 changes: 21 additions & 0 deletions Haeil/6주차/2588.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <stdio.h>

int main() {
int number1;
int number2;
int number2_1;
int number2_2;
int number2_3;
printf("");
scanf("%d", &number1);
printf("");
scanf("%d", &number2);
number2_1 = number2/100;
number2_2 = (number2/10) % 10;
number2_3 = (number2%100) %10;
printf("%d\n", number1 * number2_3);
printf("%d\n", number1 * number2_2);
printf("%d\n", number1 * number2_1);
printf("%d\n", number1 * number2);
return 0;
}
19 changes: 19 additions & 0 deletions Haeil/6주차/2908.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <stdio.h>

int main() {
int num1;
int num2;
int answer;
printf("");
scanf("%d", &num1, &num2);
num1 = ((num1%10) * 100 ) + (((num1 % 100)/10) * 10) + num1 / 100;
num2 = ((num2%10) * 100 ) + (((num2 % 100)/10) * 10) + num2 / 100;
if (num1 > num2) {
answer = num1;
}
else if (num1 < num2) {
answer = num2;
}
printf("%d", answer);
return 0;
}
29 changes: 29 additions & 0 deletions Haeil/7주차/10103.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include <stdio.h>
void compare(int a, int b, int *chang_score, int *sang_score) {
if (a > b) {
*sang_score -= a;
}
if (a < b) {
*chang_score -= b;
}

}

int main() {
int chang_score = 100;
int sang_score = 100;
int num;
int chang_dice;
int sang_dice;
printf("");
scanf("%d", &num);
for (int i = 0; i < num; i++) {
printf("");
scanf("%d %d", &chang_dice, &sang_dice);
compare(chang_dice,sang_dice, &chang_score, &sang_score);

}
printf("%d %d", chang_score, sang_score);
return 0;

}
30 changes: 30 additions & 0 deletions Haeil/7주차/14625.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <stdio.h>

int main() {
int start_hour;
int start_min;
int end_hour;
int end_min;
int num;
int answer = 0;
printf("");
scanf("%d %d", &start_hour, &start_min);
printf("");
scanf("%d %d", &end_hour, &end_min);
printf("");
scanf("%d", &num);
for (int i = start_hour; i <= end_hour; i++) {
for (int j = 0; j < 60; j++) {
if ((i == start_hour && j < start_min )||(i == end_hour && j > end_min)) {
continue;
}
if (i/10 == num || i%10 == num || j/10 == num || j%10 == num) {
answer += 1;
}
}
}
printf("%d", answer);
return 0;


}
22 changes: 22 additions & 0 deletions Haeil/7주차/4153.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <stdio.h>

int main() {
int l;
int m;
int n;
while(1) {
printf("");
scanf("%d %d %d", &l, &m, &n);
if (l == 0 && m == 0 && n == 0) {
break;
}
if (l*l + m*m == n*n || l*l + n*n == m*m || m*m + n*n == l*l) {
printf("right\n");
}
else {
printf("wrong\n");
}
}
return 0;

}
18 changes: 18 additions & 0 deletions Haeil/computer.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <stdio.h>
int main() {
int a, b, t, i, j, pc;
scanf("%d", &t);
for (i = 0; i < t; i++) {
pc = 1;
scanf("%d %d", &a, &b);
b %= 4;
if(b==0)
b = 4;
for (j = 1; j <= b; j++) {
pc = (pc * a) % 10;
}
if (pc == 0)
pc = 10;
printf("%d\n", pc);
}
}
1 change: 1 addition & 0 deletions Summer_C_study
Submodule Summer_C_study added at ae1da1