#include <stdio.h>

int main() {
    int n[6],s[10];
    char c[6];
    int o=0,p=0;
    for(int i=0;i<5;i++)
    {
        scanf(" %c",&c[i]);
        scanf("%d",&n[i]);
    }
    for(int i=0;i<5;i++)
    {
        for(int j=i;j<5;j++)
        {
            if(c[i]==c[j])
            {
                o++;
            }
        }
    }
    for(int i=1;i<=9;i++)
    {
        for(int j=0;j<5;j++)
        {
            if(i==n[j]) s[i]++;
        }
    }
    for(int i=0;i<9;i++)
    {
        if(s[i]==4) p=+800;
        else if(s[i]==3)
        {
            for(int j=0;j<9;j++)
            {
                if(s[j]==2)
                {
                    p=700+i*10+j;
                    break;
                }
                else 
                {
                    p=400+i;
                }
            }
        }
        else if(s[i]==2)
        {
            for(int j=0;j<9;j++)
            {
                if(s[j]==2 && j!=i)
                {
                    p=300+j*10+i;
                    break;
                }
                else 
                {
                    p=200+i;
                }
            }
        }
    }
    printf("%d",p);
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: