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

fe week1 work done #5

Open
wants to merge 1 commit into
base: 박소희
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
24 changes: 24 additions & 0 deletions bj10818.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
let input = require("fs")
.readFileSync("/dev/stdin")
.toString()
.trim()
.split(/\s/);
let N = Number(input[0]);
// let stringNumbers = input[1].split(" ");
// let numbers = stringNumbers.map(Number);

let num = Number(input[1]);
let max = num;
let min = num;

for (let i = 1; i < N; i++) {
num = Number(input[i + 1]);
if (max < num) {
max = num;
}
if (min > num) {
min = num;
}
}

console.log(min, max);
9 changes: 9 additions & 0 deletions bj10869.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
let input = require("fs").readFileSync("/dev/stdin").toString().split(" ");
let num1 = Number(input[0]);
let num2 = Number(input[1]);

console.log(num1 + num2);
console.log(num1 - num2);
console.log(num1 * num2);
console.log(Math.floor(num1 / num2));
console.log(num1 % num2);
13 changes: 13 additions & 0 deletions bj2438.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
let input = require("fs").readFileSync("/dev/stdin").toString().split(" ");
let num = Number(input[0]);

let answer = "";

for (let i = 0; i < num; i++) {
for (let j = 0; j < i + 1; j++) {
answer += "*";
}
answer += "\n";
}

console.log(answer);
1 change: 1 addition & 0 deletions bj2557.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("Hello World!");
11 changes: 11 additions & 0 deletions bj2741.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
let input = require("fs").readFileSync("/dev/stdin").toString().split(" ");
let num = Number(input[0]);

let answer = "";

// 이렇게 문자열로 한번에 묶어서 출력하면 시간 초과 안뜸
for (let i = 0; i < num; i++) {
answer += i + 1 + "\n";
}

console.log(answer);
8 changes: 8 additions & 0 deletions bj2753.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
let input = require("fs").readFileSync("/dev/stdin").toString().split(" ");
let year = Number(input[0]);

if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {
console.log(1);
} else {
console.log(0);
}
14 changes: 14 additions & 0 deletions bj3052.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
let input1 = require("fs").readFileSync("/dev/stdin").toString().split("\n");
numbers = input1.map(Number);

let arr = [];
let num = numbers[0] % 42;

for (let i = 0; i < 10; i++) {
num = numbers[i] % 42;
if (arr.indexOf(num) === -1) {
arr.push(num);
}
}

console.log(arr.length);
14 changes: 14 additions & 0 deletions bj9498.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
let input = require("fs").readFileSync("/dev/stdin").toString().split(" ");
let score = Number(input[0]);

if (score >= 90) {
console.log("A");
} else if (score >= 80) {
console.log("B");
} else if (score >= 70) {
console.log("C");
} else if (score >= 70) {
console.log("D");
} else {
console.log("F");
}