38202023-03-03 09:53:27DalmaMorze (60 pont)cpp17Wrong answer 23/603ms3736 KiB
#include <iostream>
#include <string>

using namespace std;

int main()
{
    string egesz;
    cin >> egesz;
    int hosszusag=egesz.length();
    char morze[hosszusag];
    int eredmeny[hosszusag/5]={0};
    for (int i=0; i<hosszusag; i++)
    {
        morze[i]=egesz[i];
    }
    for (int i=1; i<=hosszusag/5; i++)
    {
        if (morze[i*5-5]=='.')
        {
            if (morze[i*5-4]=='.')
            {
                if (morze[i*5-3]=='.')
                {
                    if (morze[i*5-2]=='.')
                    {
                        if (morze[i*5-1]=='.')
                        {
                            eredmeny[i-1]=5;
                        }
                        else if (morze[i*5-1]=='-')
                        {
                            eredmeny[i-1]==4;
                        }
                    }
                    else if (morze[i*5-2]=='-')
                    {
                        if (morze[i*5-1]=='-')
                        {
                            eredmeny[i-1]=3;
                        }
                    }
                }
                else if (morze[i*5-3]=='-')
                {
                    eredmeny[i-1]=2;
                }
            }
            else if (morze[i*5-4]=='-')
            {
                eredmeny[i-1]=1;
            }
        }
        else if (morze[i*5-5]=='-')
        {
            if (morze[i*5-4]=='.')
            {
                eredmeny[i-1]=6;
            }
            else if (morze[i*5-4]=='-')
            {
                if (morze[i*5-3]=='.')
                {
                    eredmeny[i-1]=7;
                }
                else if (morze[i*5-3]=='-')
                {
                    if (morze[i*5-2]=='.')
                    {
                        eredmeny[i-1]=8;
                    }
                    else if (morze[i*5-2]=='-')
                    {
                        if (morze[i*5-1]=='.')
                        {
                            eredmeny[i-1]=9;
                        }
                        else if (morze[i*5-1]=='-')
                        {
                            eredmeny[i-1]==0;
                        }
                    }
                }
            }
        }
    }
    for (int i=0; i<hosszusag/5; i++)
    {
        cout << eredmeny[i];
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base23/60
1Wrong answer0/03ms1808 KiB
2Wrong answer0/03ms2060 KiB
3Accepted3/33ms2308 KiB
4Accepted3/32ms2488 KiB
5Accepted3/33ms2692 KiB
6Wrong answer0/32ms2724 KiB
7Accepted3/33ms2972 KiB
8Accepted3/32ms2972 KiB
9Accepted4/42ms2936 KiB
10Accepted4/42ms2940 KiB
11Wrong answer0/43ms3184 KiB
12Wrong answer0/72ms3152 KiB
13Wrong answer0/73ms3284 KiB
14Wrong answer0/83ms3524 KiB
15Wrong answer0/83ms3736 KiB