답안 #15539

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
15539 2015-07-12T08:59:58 Z indosm 님 무기가 좀 나쁘시네여 (kriii3_S) C++
0 / 29
0 ms 1084 KB
#include <stdio.h>
#include <stdlib.h>

int main(){

    int i, j, k;
    int cri[2][5], pib[2][5];
    double a, b, c, d, e;
    double crij[2], pibj[2];

    for(i = 0; i<2; i++)
    {
        for(j = 0; j < 5; j++)
        {
            scanf("%d", &cri[i][j]);
        }
        for(j = 0; j<5; j++)
        {
            scanf("%d", &pib[i][j]);
        }
    }

    if(cri[0][2] >100) cri[0][2] = 100;
    if(cri[1][2] >100) cri[1][2] = 100;
    if(pib[0][2] >100) pib[0][2] = 100;
    if(pib[1][2] >100) pib[1][2] = 100;

    a = (double)cri[0][0];
    b = 1.0 + ((double)cri[0][1] / 100.0);
    c = 1 - ((double)cri[0][2] / 100.0);
    d = ((double)cri[0][2] / 100.0) * (double)cri[0][3] / 100.0;
    e = 1 + ((double)cri[0][4] / 100.0);
    crij[0] = a * b * (c+d) * e;
    for(i = 0; i<5; i++)
    {
        cri[0][i] = cri[0][i] - cri[1][i];
        cri[0][i] = cri[0][i] + pib[1][i];
    }
    a = (double)cri[0][0];
    b = 1.0 + ((double)cri[0][1] / 100.0);
    c = 1 - ((double)cri[0][2] / 100.0);
    d = ((double)cri[0][2] / 100.0) * (double)cri[0][3] / 100.0;
    e = 1 + ((double)cri[0][4] / 100.0);
    crij[1] = a * b * (c+d) * e;

    a = (double)pib[0][0];
    b = 1.0 + ((double)pib[0][1] / 100.0);
    c = 1 - ((double)pib[0][2] / 100.0);
    d = ((double)pib[0][2] / 100.0) * (double)pib[0][3] / 100.0;
    e = 1 + ((double)pib[0][4] / 100.0);
    pibj[0] = a * b * (c+d) * e;

    for(i = 0; i<5; i++)
    {
        pib[0][i] = pib[0][i] - pib[1][i];
        pib[0][i] = pib[0][i] + cri[1][i];
    }
    a = (double)pib[0][0];
    b = 1.0 + ((double)pib[0][1] / 100.0);
    c = 1 - ((double)pib[0][2] / 100.0);
    d = ((double)pib[0][2] / 100.0) * (double)pib[0][3] / 100.0;
    e = 1 + ((double)pib[0][4] / 100.0);
    pibj[1] = a * b * (c+d) * e;

    if(crij[0] < crij[1])
    {
        printf("-\n");
    }
    else if(crij[0] == crij[1])
    {
        printf("0\n");
    }
    else
    {
        printf("+\n");
    }
    if(pibj[0] < pibj[1])
    {
        printf("-\n");
    }
    else if(pibj[0] == pibj[1])
    {
        printf("0\n");
    }
    else
    {
        printf("+\n");
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Incorrect 0 ms 1084 KB Output isn't correct
3 Halted 0 ms 0 KB -