Skip to content

Instantly share code, notes, and snippets.

View JoeUnsung's full-sized avatar
🏠
Working from home

Joe JoeUnsung

🏠
Working from home
  • SSG.COM
  • Seoul
View GitHub Profile
@JoeUnsung
JoeUnsung / checkPassword
Created November 26, 2016 12:31
Check password validation, if it has recurring character more than twice.
package joe;
import java.util.*;
import java.lang.*;
import java.io.*;
class Check{
@JoeUnsung
JoeUnsung / randomGame
Created November 26, 2016 15:57
Try to get answer number between 1 and 100.
package joe;
import java.util.*;
public class HW3_20101062_1 {
public static void main(String[] args){
// 1~100 사이의 임의의 값을 얻어서 answer 에 저장한다.
int cnt = 0, input = 0;
@JoeUnsung
JoeUnsung / newHangManGame
Created November 26, 2016 16:01
Play hangman. Enjoy.
package joe;
import java.util.*;
public class P8_20101062_1 {
public static void main(String[] args){
Random r = new Random();
package joe;
import java.lang.*;
import java.util.*;
class Connection {
private String departure;
private String arrival;
@JoeUnsung
JoeUnsung / includeChar
Created December 7, 2016 03:20
Check the number of including specific string in another string.
package joe;
import java.lang.*;
import java.util.*;
import java.io.*;
public class HW3_PRAC {
public static int count(String src, String target){
char temp1, temp2;
@JoeUnsung
JoeUnsung / EX1
Created December 8, 2016 16:41
Testcode #1
package joe;
import java.lang.*;
import java.util.*;
public class E1_20101062 {
public static void main(String[] args){
String[] color = {"red", "green", "blue", "white", "black", "yellow", "pink", "grey"};
Queue myQue = new LinkedList();
Stack myStack = new Stack();
@JoeUnsung
JoeUnsung / EX2
Created December 8, 2016 16:42
Testcode #2 ; Find out what row and line will make most "1" in the matrix when it is reversed.
package joe;
public class E2_20101062 {
public static void main(String[] args){
int N=8, M=5;
int[][] map = {{1,0,1,1,0},
{0,0,1,0,0},
{1,0,0,0,1},
@JoeUnsung
JoeUnsung / stringMystery
Last active December 17, 2016 17:56
Making string as a secret mode
import java.util.*;
import java.lang.*;
class Main {
public static String reverseString(String s) {
return ( new StringBuffer(s) ).reverse().toString();
}
public static void main(String[] args) {
@JoeUnsung
JoeUnsung / avgCnt
Created December 17, 2016 17:56
calculate average
import java.util.*;
import java.text.*;
class Main {
public static double avgCnt(int[] list, int cnt){
double sum = 0;
for(int i = 0 ; i < cnt ; i++){
sum += (double)list[i];
}
@JoeUnsung
JoeUnsung / completeNum
Created December 17, 2016 17:57
Check the number whether complete number or not.
import java.util.*;
import java.io.*;
class Main {
public static int checkCompleteNum(int num){
// 숫자가 완전제곱수인지를 체크하는 메서드 작성.
for(int i = 0 ; i < num ; i++){
if ( num == i*i ){