File tree 1 file changed +55
-27
lines changed
1 file changed +55
-27
lines changed Original file line number Diff line number Diff line change 301
301
302
302
303
303
304
- #### 2023년 2회
304
+ #### 2022년 2회 [ 3개 출제 ]
305
305
306
- - 문제1. 다음 C언어로 구현된 프로그램에 54321 을 입력시킨 결과가 43215일 때, <처리조건>을 참고하여 괄호에 들어갈 알맞은 식을 쓰시오.
307
-
308
- > <처리조건>
309
- >
310
- > - 괄호의 식에 사용할 문자는 다음으로 제한한다.
311
- > - n, i
312
- > - +, -, /, * , %
313
- > - 0~ 9, (, ), [ , ]
314
- ``` C
315
- #include < stdio.h>
306
+ - 문제8. 다음 C언어로 구현된 프로그램을 분석하여 그 실행 결과를 쓰시오. (단, 출력문의 출력 서식을 준수하시오)
307
+
308
+ ``` c
309
+ #include < stdio.h>
316
310
317
- int main (void) {
318
-
319
- int n[ 5] ;
320
- int i;
321
-
322
- for (i=0; i<5; i++) {
323
- printf("숫자를 입력해주세요 : ");
324
- scanf("%d", &n[ i] );
325
- }
326
-
327
- for (i=0; i<5; i++) {
328
- printf("%d", ( 괄호 ));
329
- }
330
-
331
- return 0;
311
+ struct A{
312
+ int n;
313
+ int g;
314
+ };
315
+
316
+ int main() {
317
+ A a = new A[ 2]
318
+ for (i=0; i <2; i++) {
319
+ a[ i] .n = i;
320
+ a[ i] .g = i+1;
321
+ }
322
+ printf ("%d", a[ 0] .n + a[ 1] .g);
332
323
}
333
324
```
334
- - 답 : n[(i+1)%5]
325
+
326
+ - [답] 2
335
327
336
328
337
329
382
374
| 3 | 4 | 5 | 3 |
383
375
| 3 | 5 | 6 | 4 |
384
376
| 3 | 5 | 5 | 3 |
377
+
378
+
379
+
380
+ #### 2023년 2회
381
+
382
+ - 문제1. 다음 C언어로 구현된 프로그램에 54321 을 입력시킨 결과가 43215일 때, <처리조건>을 참고하여 괄호에 들어갈 알맞은 식을 쓰시오.
383
+
384
+ > <처리조건>
385
+ >
386
+ > - 괄호의 식에 사용할 문자는 다음으로 제한한다.
387
+ > - n, i
388
+ > - +, -, /, * , %
389
+ > - 0~ 9, (, ), [ , ]
390
+
391
+ ``` C
392
+ #include < stdio.h>
393
+
394
+ int main (void) {
395
+
396
+ int n[ 5] ;
397
+ int i;
398
+
399
+ for (i=0; i<5; i++) {
400
+ printf("숫자를 입력해주세요 : ");
401
+ scanf("%d", &n[ i] );
402
+ }
403
+
404
+ for (i=0; i<5; i++) {
405
+ printf("%d", ( 괄호 ));
406
+ }
407
+
408
+ return 0;
409
+ }
410
+ ```
411
+
412
+ - 답 : n[(i+1)%5]
You can’t perform that action at this time.
0 commit comments