공지사항

2025S년 2회 정보처리기사 실기 모범답안

https://docs.google.com/spreadsheets/d/1DMxbt3hLEH9-2izuLqs-JyYq_juvjGX3k96f-eLW1bo/edit?usp=sharing



2025년 2회 정보처리기사실기 모범답안
시험일 :2025-07-19
번호분류문제답안
1색인(index,인덱스)
2`ㄷ.attribute
3SSH
4SJF, SRT
5Cpublic 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
6ipv4 130.52?.?.132/ 255.255.255.192일때 네트워크 주소 xxx.xxx.xxx.(1),
네트워크 주소에서 사용가능한 호스트 개수는 브로드캐스트와 네트워크 주소를 뺀 (2)개이다.
128, 62
7Proxy
8AJAX
9JAVApublic 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
10class 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
12C#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
13RR 평균대기시간11.75
14Cstruct 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
15JAVApublic 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
16JAVAstruct 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
17PYTHONdef 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
18Cstruct 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
19TCP 3-way handshaking 문제점 이용ㄹ.SYN 플러딩
20관계대
TTL, 부장, 과장, 차장, 대리