Skip to content

Commit 6b6c11d

Browse files
authored
Merge pull request jsk3342#178 from yeeed711/main
2 parents 44f80a5 + 9fdad51 commit 6b6c11d

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# 문제18 : 평균 점수
2+
3+
영하네 반은 국어, 수학, 영어 시험을 보았습니다. 영하는 친구들의 평균 점수를 구해주기로 했습니다.
4+
5+
공백으로 구분하여 세 과목의 점수가 주어지면 전체 평균 점수를 구하는 프로그램을 작성하세요.
6+
단, 소숫점 자리는 모두 버립니다.
7+
8+
```jsx
9+
**입출력**
10+
11+
입력 : 20 30 40
12+
출력 : 30
13+
```
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
# 문제18 : 평균 점수
3+
4+
영하네 반은 국어, 수학, 영어 시험을 보았습니다. 영하는 친구들의 평균 점수를 구해주기로 했습니다.
5+
6+
공백으로 구분하여 세 과목의 점수가 주어지면 전체 평균 점수를 구하는 프로그램을 작성하세요.
7+
단, 소숫점 자리는 모두 버립니다.
8+
9+
**입출력**
10+
11+
입력 : 20 30 40
12+
출력 : 30
13+
14+
*/
15+
16+
const store = prompt().split(" ");
17+
let sum = 0;
18+
for (i = 0; i < store.length; i++) {
19+
sum += parseInt(store[i]);
20+
}
21+
console.log(Math.floor(parseInt(sum) / store.length));

Problems/019.square/solve.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
// 문제19 : 제곱을 구하자
22

3-
// 공백으로 구분하여 두 숫자 a와 b가 주어지면, a의 b승을 구하는 프로그램을 작성하세요.
3+
// 공백으로 구분하여 두 숫자 a와 b가 주어지면, a의 b승을 구하는 프로그램을 작성하세요.
4+
5+
const num = prompt().split(" ");
6+
console.log(Math.pow(num[0], num[1]));

0 commit comments

Comments
 (0)