티스토리 뷰
반응형
.입출력
.입출력
- BufferedReader
1 2 3 4 5 6 7 | BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int T = Integer.parseInt(br.readLine()); // int String str = br.readLine(); // string StringTokenizer st = new StringTokenizer(br.readLine()); int N = Integer.parseInt(st.nextToken()); int M = Integer.parseInt(st.nextToken()); | cs |
- Scanner
1 2 3 | Scanner sc = new Scanner(System.in); int T = sc.nextInt(); // int String str = sc.next(); // string | cs |
- 배열 원소 확인(Test)
1 | System.out.println(Arrays.toString(chk)); | cs |
--
--
--
.자료형
.String to Char
1 | char motion[] = br.readLine().toCharArray(); | cs |
.Object Sort
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | public static class Student implements Comparable<Student>{ int mid,finals,assign,index; int score; public Student(int mid,int finals,int assign,int index){ this.mid = mid; this.finals = finals; this.assign = assign; this.index = index; score =mid*35 + finals*45 + assign*20; } @Override public int compareTo(Student o) { return score - o.score; } } | cs |
.2차원 ArrayList
1 2 3 4 | ArrayList<Integer> nodes[] = new ArrayList[N]; for (int i = 0; i < N; i++) nodes[i] = new ArrayList<Integer>(); | cs |
.Iterator
1 2 3 4 5 6 7 | public void printPatientList() { Iterator<Patient> itr = patientList.iterator(); while(itr.hasNext()){ Patient p = itr.next(); System.out.println(p); } } | cs |
.메모리
.배열 메모리 초기화
1 | Arrays.fill(chk, 0); | cs |
--
--
--
.
--
--
--
--
.
--
--
--
--
반응형
'PS > PS_Note' 카테고리의 다른 글
[JAVA] 코딩테스트에 자주 나오는 Map, Set 자료형(JAVA) (0) | 2020.10.17 |
---|---|
[Python] PS Coding Tip (~ing) (0) | 2020.05.13 |
[C/C++] STL map 활용 (0) | 2020.05.13 |
[C/C++] 자주 사용하는 C++ STL 자료구조 (vector, pair, queue, priority_queue) (0) | 2020.05.02 |
[C/C++] C++ Algorithm Note (~ing) (0) | 2020.04.23 |
댓글