분류 전체보기

import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int result = N; int count = 0; while(true) { N = ((N % 10) * 10) + (((N / 10) + (N % 10)) % 10); count++; if(N == result) { System.out.println(count); break; } } } } 설명 위 문제는 두 자릿수의 각 자리의 숫자를 더한 뒤 주어진 수의 가장 오른쪽 자리 수와 앞에서 구한 합의 가장 오른쪽 자릿수를 이어 붙인 뒤 새로운 수를..
· 웹 개발
1) MyBatis란? 마이 바티스(MyBatis)란 자바의 프레임워크 중 하나로 XML이나 애너테이션(annotation)을 사용하여 저장 프로시저나 SQL문으로 객체들을 연결시킬 수 있는 소프트웨어이다. 마이 바티스에서는 프로그램에 있는 SQL 쿼리들을 한 구성 파일에 구성하여 프로그램 코드와 SQL을 분리할 수 있는 장점을 지닌다. 마이 바티스를 활용하면 복잡한 JDBC 코드를 깔끔하게 정리할 수 있다는 장점이 있다. XML 형태로 작성된 JDBC 코드라고 말할 정도로 JDBC의 모든 기능을 제공한다. 2) MyBatis 활용 간단하게 위의 이미지처럼 오라클에 저장된 부서테이블의 부서 번호, 부서 이름, 부서위치를 출력해보려 한다. --부서테이블 CREATE TABLE DEPT( DEPTNO NUM..
import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int num = sc.nextInt(); ArrayList ar = new ArrayList(); for(int i=0; i
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); for(int i=0; i
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int N = sc.nextInt(); for(int i=0; i
· 웹 개발
1) AJAX란? AJAX(Asynchronous JavaScript And XML)란 비동기 자바스크립트와 XML을 말한다. 쉽게 설명하면, 서버와 통신을 하기 위해 XMLHttpRequest 객체를 사용하는 것을 말한다. 이때 JSON, XML, HTML, 일반 텍스트 형식을 포함한 다양한 포맷을 주고받을 수 있다. 현재는 JSON을 가장 많이 다룬다고 한다. 비동기(async) 방식이란? - 웹페이지를 새로고침하지 않고 데이터를 불러오는 방식을 뜻한다. 전체 페이지를 새로고침 하지 않고 필요한 일부의 데이터만을 갱신할 수 있게 해 준다. AJAX를 사용하는 가장 큰 이유는, 페이지 전체를 새로고침(Refresh) 하지 않고서도 수행되는 "비동기성" 때문이다. 예를 들어 설명하자면, 회원가입 시 아이..
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num1 = sc.nextInt(); int num2 = sc.nextInt(); int num3 = sc.nextInt(); if(num1 == num2 && num2 == num3) { System.out.println(10000 + (num1*1000)); } else if(num1 == num2 && num1 != num3) { System.out.println(1000 + (num1*100)); } else if(num2 == num3 && num1 != num2) { ..
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(); int m = sc.nextInt(); int time = sc.nextInt(); int result_m = m + time; if((result_m / 60) > 0) { h += result_m/60; result_m = result_m%60; } if(h >= 24) h -= 24; System.out.println(h + " " + result_m); } } 설명 위 문제는 시작하는 h, m(시, 분)과 조리하는 데 걸리는 시간(time)..
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int H = sc.nextInt(); // 시 int M = sc.nextInt(); // 분 if(M < 45) { H--;// 시(hour) 1 감소 M= 60 - (45 - M); // 분(min) 감소 if(H < 0) { H = 23; } System.out.println(H + " " + M); } else { System.out.println(H + " " + (M - 45)); } } } 설명 위 문제는 Scanner를 통해 사용자에게 시, 분을 입력받고, 그 시간보다 ..
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int X = sc.nextInt(); int Y = sc.nextInt(); if(X > 0) { if(Y > 0) { System.out.print(1); } else { System.out.print(4); } } else { if(Y > 0) { System.out.print(2); } else { System.out.print(3); } } } } 설명 사분면 고르기 문제는 Scanner를 이용해 사용자에게 x, y를 입력받은 뒤, x와 y를 조건문을 통해 양수인지 정수인지 판..
빡수수
'분류 전체보기' 카테고리의 글 목록 (8 Page)