Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.5 kB
3
Indexable
Never
#include <stdio.h>

int main()
{
    int init_day;
    int day;
    printf("Enter number of days\n");
    scanf("%d",&day);
    init_day = day;
    int n1=0;    //Makaroni
    int n2=0;    //GhormehSabzi
    int n3=0;    //HavijPolo
    int n4=0;    //KhoreshKarafs
    int n5=0;    //SabziPoloBaMahi
    int n6=0;    //CheloGardan
    int n7=0;    //KalePacheh
    int n8=0;    //Kotlet
    int n9=0;    //AshReshteh
    int n10=0;   //SaladShirazi

    while(day != 0)
    {
        int food;
        scanf("%d", &food);
        switch(food)
        {
        case 1:
            n1++;
            break;

        case 2:
            n2++;
            break;

        case 3:
            n3++;
            break;

        case 4:
            n4++;
            break;

        case 5:
            n5++;
            break;

        case 6:
            n6++;
            break;

        case 7:
            n7++;
            break;

        case 8:
            n8++;
            break;

        case 9:
            n9++;
            break;

        case 10:
            n10++;
            break;
        }
        day--;
    }
        int sum = n1 * 329 + n2 * 127 + n3 * 61 + n4 * 83 + n5 * 156 + n6 * 296 + n7 * 496 + n8 * 73 + n9 *34 + n10 * 16;
        if((sum - (100 * init_day)) > 0)
        {
            printf("chagh");
        }
        else if((sum - (100 * init_day)) < 0 )
        {
            printf("laghar");
        }
        else
        {
            printf("bedoon taghir");
        }
        return 0;
}