Skip to content

Instantly share code, notes, and snippets.

View wjh51333's full-sized avatar

Jeehyun Woo wjh51333

View GitHub Profile
import java.util.*
fun main() {
val sc = Scanner(System.`in`)
while (true) {
val result = sum(sc.nextInt(), sc.nextInt())
if (result == 0)
break
println(result)
}
@wjh51333
wjh51333 / BubbleSort.cpp
Last active October 19, 2021 12:03
Algorithm
void bubbleSort(int[] arr) {
int temp = 0;
for(int i = 0; i < arr.length; i++) { // 1.
for(int j= 1 ; j < arr.length-i; j++) { // 2.
if(arr[j-1] > arr[j]) { // 3.
// swap(arr[j-1], arr[j])
temp = arr[j-1];
arr[j-1] = arr[j];
arr[j] = temp;
}
#include <iostream>
#include <algorithm>
using namespace std;
int cnt[101];
int main()
{
int T, k;
cin>>T;
val numbers : List<String> = listOf("one", "two", "three", "four")
// val numbers = listOf("one", "two", "three", "four")
println("Number of elements: ${numbers.size}")
println("Third element: ${numbers.get(2)}")
println("Fourth element: ${numbers[3]}")
println("Index of element \"two\" ${numbers.indexOf("two")}")
🌞 Morning 36 commits █▎░░░░░░░░░░░░░░░░░░░ 6.3%
🌆 Daytime 93 commits ███▍░░░░░░░░░░░░░░░░░ 16.4%
🌃 Evening 372 commits █████████████▊░░░░░░░ 65.5%
🌙 Night 67 commits ██▍░░░░░░░░░░░░░░░░░░ 11.8%
#include <iostream>
#include <cstring>
#define MAX 101
using namespace std;
int n;
char map[MAX][MAX];
bool visited[MAX][MAX];
int dx[] = { -1, 1, 0, 0 };
@wjh51333
wjh51333 / [프로그래머스] 네트워크.cpp
Last active August 6, 2021 09:33
프로그래머스 문제풀이
#include <string>
#include <vector>
#define MAX 200
using namespace std;
bool visited[MAX];
void dfs(vector<vector<int>> &computers, int now) {
visited[now] = true;
private var map = arrayOf<IntArray>()
private var visited = arrayOf<BooleanArray>()
private var n = 0
private var m = 0
private val dx = arrayOf(-1, 1, 0, 0)
private val dy = arrayOf(0, 0, -1, 1)
fun main() = with(System.`in`.bufferedReader()) {
val tc = readLine().toInt()