공지사항
https://docs.google.com/spreadsheets/d/1DMxbt3hLEH9-2izuLqs-JyYq_juvjGX3k96f-eLW1bo/edit?usp=sharing
2025년 2회 정보처리기사실기 모범답안 | |||
| 시험일 : | 2025-07-19 | ||
| 번호 | 분류 | 문제 | 답안 |
| 1 | 색인(index,인덱스) | ||
| 2 | `ㄷ.attribute | ||
| 3 | SSH | ||
| 4 | SJF, SRT | ||
| 5 | C | public class Main { public static void change(String[] data, String s){ data[0] = s; s = "Z"; } public static void main(String[] args) { String data[] = { "A" }; String s = "B"; change(data, s); System.out.print(data[0] + s); } } | BB |
| 6 | ipv4 130.52?.?.132/ 255.255.255.192일때 네트워크 주소 xxx.xxx.xxx.(1), 네트워크 주소에서 사용가능한 호스트 개수는 브로드캐스트와 네트워크 주소를 뺀 (2)개이다. | 128, 62 | |
| 7 | Proxy | ||
| 8 | AJAX | ||
| 9 | JAVA | public class Dumok { static interface F { int apply(int x) throws Exception; } public static int run(F f) { try { return f.apply(3); } catch (Exception e) { return 7; } } public static void main(String[] args) { F f = (x) -> { if (x > 2) { throw new Exception(); } return x * 2; }; System.out.print(run(f) + run((int n) -> n + 9)); // 7 + 12 == 19 } } | 19 |
| 10 | class P { static String print() { return "P"; } int sum(int a) { return a + 1; } } class C extends P { static String print() { return "C"; } int sum(int a) { return a + 2; } } public class Gisafirst { public static void main(String[] args) { P tmp = new C(); System.out.println(tmp.sum(3) + tmp.print()); } } | 5P | |
| 11 | 분기 커버리지 | 1) 1234567 2)124561 or 1)1234561 2)124567 | |
| 12 | C | #define SIZE 3 typedef struct { int a[SIZE]; int front; int rear; } Queue; void enq(Queue* q, int val) { q->a[q->rear] = val; q->rear = (q->rear + 1) % SIZE; } int deq(Queue* q) { int val = q->a[q->front]; q->front = (q->front + 1) % SIZE; return val; } int main() { Queue q = {{0}, 0, 0}; enq(&q, 1); enq(&q, 2); deq(&q); enq(&q, 3); printf("%d 그리고 %d", deq(&q), deq(&q)); return 0; } | 2 그리고 3 |
| 13 | RR 평균대기시간 | 11.75 | |
| 14 | C | struct dat { int x; int y; }; int main() { struct dat a[] = {{1, 2}, {3, 4}, {5, 6}}; struct dat* ptr = a; struct dat** pptr = &ptr; (*pptr)[1] = (*pptr)[2]; printf("%d 그리고 %d", a[1].x, a[1].y); return 0; } | 5 그리고 6 |
| 15 | JAVA | public class Dumok { public static class BO { public int v; public BO(int v) { this.v = v; } } public static void main(String[] args) { BO a = new BO(1); BO b = new BO(2); BO c = new BO(3); BO[] arr = {a, b, c}; BO t = a; arr[0] = c; arr[2] = t; arr[1].v = arr[0].v; System.out.println(a.v + "a" + b.v + "b" + c.v); } } | 1a3b3 |
| 16 | JAVA | struct node { int p; struct node* n; }; int main() { struct node a = {1, NULL}; struct node b = {2, NULL}; struct node c = {3, NULL}; c.n = &a; a.n = &b; b.n = NULL; struct node* head = &c; printf("%d %d %d", head->p, head->n->p, head->n->n->p); return 0; } | 2003 1 2 |
| 17 | PYTHON | def gisafirst(): lst = [1,2,3] dic = {x:x * 2 for x in lst} s = set(dic.values()) lst[0] = 99 dic[2] = 7 s.add(99) return len(s & set(dic.values())) print(gisafirst()) | 2 |
| 18 | C | struct node { char c; struct node* p; }; struct node* func(char* s) { struct node* h = NULL, *n; while(*s) { n = malloc(sizeof(struct node)); n->c = *s++; n->p = h; h = n; } return h; } int main() { struct node* n = func("BEST"); while(n) { putchar(n->c); struct node* t = n; n = n->p; free(t); } return 0; } | TSEB |
| 19 | TCP 3-way handshaking 문제점 이용 | ㄹ.SYN 플러딩 | |
| 20 | 관계대 | TTL, 부장, 과장, 차장, 대리 |
두목넷9