2019년 3월 31일

어학 2019. 3. 31. 19:52

1. The version of events/ given by the witness/ was markedly different from that

given by the defendant during the trial.

 

2. Orders/ recieved by the online shopping site/ are dispatched

by a courier once the warehouse packs the items and puts labels on the boxes.

 

3. Employees do not generally perform well in a competitive environment

because the rivalry breads a lack of trust among the staff.

 

'어학' 카테고리의 다른 글

2019년 04월 04일  (0) 2019.08.16
2019년 04월 03일  (0) 2019.08.06
2019년 04월 02일  (0) 2019.08.06
2019년 04월 01일  (0) 2019.07.30
2019년 3월 30일  (0) 2019.03.31
Posted by 이미안녕
,

2019년 3월 30일

어학 2019. 3. 31. 19:01

1. The data demonstrates the difficulty of determining the real efficacy of vitamin supplements

when taken with balanced, nutritious meals.

 

2. The client approved of the interior designer's choice of colors for the living and dining areas

as well as the kitchen

 

3. The database was updated, but the clerk did not do it thoroughly,

with the result that some customers were missing from the directory.

 

'어학' 카테고리의 다른 글

2019년 04월 04일  (0) 2019.08.16
2019년 04월 03일  (0) 2019.08.06
2019년 04월 02일  (0) 2019.08.06
2019년 04월 01일  (0) 2019.07.30
2019년 3월 31일  (0) 2019.03.31
Posted by 이미안녕
,


당신은 택배회사 사장이다


택배 상자는 2가지 종류가 있다.


5개 짜리 박스, 3개  짜리 박스.



주문이 들어오면 저 두가지 박스에 나눠서 넣는데,


5개 짜리 박스가 가성비가 좋아 최대한 많이 사용해야 한다.



1. 5개 짜리, 3개 짜리 박스로 포장이 불가능한 주문은 -1 리턴


ex) 17 


2. 5개 짜리 박스를 최대한 많이 사용

ex) input : 18,  output : 3, 1






의식의 흐름대로 짰을 경우 아래와 같다



#include <stdio.h>


void packing(int post) {

    int count_5 = 0;

    int count_3 = 0;

    if (post % 5 == 0 || post % 3 == 0) {

        count_5 = post / 5;

        count_3 = (post - (count_5 * 5)) / 3;

        while (1) {

            if ( (post - (count_5 * 5) - (count_3 * 3)) == 0) {

                printf("count_5 = %d, count_3 = %d\n", count_5, count_3);

                return;

            } else {

                count_5--;

                count_3 = (post - (count_5 * 5)) /3;

            }

        }

        printf("??\n");

    } else {

        printf("-1\n");

        return;

    }

}


int main() {

    int post = 21;

    scanf("%d", &post);


    packing(post);


    return 0;


}



'Programming > Programmers 알고리즘 문제' 카테고리의 다른 글

structsize  (0) 2019.10.24
arrayshift  (0) 2019.10.24
quickselect  (0) 2019.10.24
quicksort  (0) 2019.10.24
파이썬 공부  (0) 2018.04.15
Posted by 이미안녕
,