문제

https://www.acmicpc.net/problem/5063

설명

광고를 하지않았을떄 수익과 광고를 했을때 순이익(광고를 했을때 발생하는 이익 - 광고 비용)의 크기를 비교해 [advertise],[do not advertise],[does not matter]로 판단 결과를 표시해달라는 것이 조건인 문제였다. 반복문으로 입력을받고 판단을하고 바로 결과를 출력하는것 외에 별 특별한 것이 없다.

코드

#include <stdio.h>

int main() {
    int n;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
    {
        int n_benefit, y_benefit, adv_cost;
        scanf("%d %d %d",&n_benefit, &y_benefit, &adv_cost);
        if(n_benefit<y_benefit-adv_cost)
            printf("advertise");
        else if (n_benefit == y_benefit-adv_cost)
            printf("does not matter");
        else if (n_benefit > y_benefit-adv_cost)
            printf("do not advertise");
        printf("\n");
    }
    return 0;
}