Click Here to go back to the homepage.

Provinces and Gold Solution:


#include <stdio.h>
#include <stdlib.h>

int main(){
    int gold, silver, copper;
    scanf("%d %d %d", &gold, &silver, &copper);
    int total = gold * 3 + silver * 2 + copper;
    if(total > 1){
        if(total > 7){
            printf("Province");
        } else if (total > 4){
            printf("Duchy");
        } else if (total > 1){
            printf("Estate");
        }
        printf(" or ");
    }
    if(total > 5){
        printf("Gold");
    } else if(total > 2){
        printf("Silver");
    } else{
        printf("Copper");
    }
    return 0;
}