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

js 1주차 과제-박서정 #13

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
8 changes: 8 additions & 0 deletions bj10818.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const input = require("fs").readFileSyns("/dev/stdin").toString().split("\n");

const count = input[0];
const nums = input[1].split("").map(Number);

nums.sort((a, b) => a - b);

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

const num1 = Number(input[0]);
const 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);
8 changes: 8 additions & 0 deletions bj2438.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
let input = requre("fs").readFileSync("/dev/stdin").toString();

let star = " ";

for (let i = 0; i < input; i++) {
star += "*";
console.log(star);
}
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!");
9 changes: 9 additions & 0 deletions bj2741.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
let input = Number(require("fs").readFileSync("/dev/stdin").toString());

let answer = " ";

for (let i = 1; i <= input; i++) {
answer += i + "\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(" ");

const A = Number(input[0]);

if ((A % 4 === 0 && A % 100 !== 0) || A % 400 === 0) {
A = 1;
}
console.log(A);
11 changes: 11 additions & 0 deletions bj3052.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const fs = require("fs");
const input = fs
.readFileSync("dev/stdin")
.toString()
.trim()
.split("\n")
.map((val) => +val);
const arr = input.map((el) => el % 42);
const set = new Set(arr);
const uniqueArr = [...set];
console.log(uniqueARr.length);
15 changes: 15 additions & 0 deletions bj9498.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const fs = require("fs");
const input = fs.readFileSync("/dev/stdin").toString();
const score = pareInt(input);

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