7529 2024. 01. 09 13:29:35 tamasmark Morze (60 pont) cpp17 Hibás válasz 23/60 3ms 3456 KiB
// morze.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <string>

using namespace std;

string egy = ".----", ketto="..---",harom="...--",negy="....-",ot=".....";
string hat = "-....", het = "--...", nyolc = "---..", kilenc = "----.", nulla = "-----";
bool egyb,kettob,haromb,negyb,otb,hatb,hetb,nyolcb,kilencb,nullab;
string s;

int main()
{
    getline(cin, s);
    for (int i = 0; i < s.size(); ++i)
    {
            if (egy[i % 5] != s[i]) egyb = true;
            if (ketto[i % 5] != s[i]) kettob = true;
            if (harom[i % 5] != s[i]) haromb = true;
            if (negy[i % 5] != s[i]) negyb = true;
            if (ot[i % 5] != s[i]) otb = true;
            if (hat[i % 5] != s[i]) hatb = true;
            if (het[i % 5] != s[i]) hetb = true;
            if (nyolc[i % 5] != s[i]) nyolcb = true;
            if (kilenc[i % 5] != s[i]) kilencb = true;
            if (nulla[i % 5] != s[i]) nullab = true;

        if (i % 5 == 4)
        {
            if (!egyb) cout << "1";
            else if (!haromb) cout << "3";
            else if (!negyb) cout << "4";
            else if (!otb) cout << "5";
            else if (!hatb) cout << "6";
            else if (!hetb) cout << "7";
            else if (!nyolcb) cout << "8";
            else if (!kilencb) cout << "9";
            else if (!nullab) cout << "0";
            egyb = false;
            kettob = false;
            haromb = false;
            negyb = false;
            otb = false;
            hatb = false;
            hetb = false;
            nyolcb = false;
            kilencb = false;
            nullab = false;

        }
    }
    return 0;
}

// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu

// Tips for Getting Started: 
//   1. Use the Solution Explorer window to add/manage files
//   2. Use the Team Explorer window to connect to source control
//   3. Use the Output window to see build output and other messages
//   4. Use the Error List window to view errors
//   5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
//   6. In the future, to open this project again, go to File > Open > Project and select the .sln file
Részfeladat Összpont Teszt Verdikt Idő Memória
base 23/60
1 Hibás válasz 0/0 3ms 1880 KiB
2 Hibás válasz 0/0 3ms 2076 KiB
3 Elfogadva 3/3 3ms 2432 KiB
4 Elfogadva 3/3 3ms 2476 KiB
5 Hibás válasz 0/3 3ms 2680 KiB
6 Elfogadva 3/3 3ms 2700 KiB
7 Elfogadva 3/3 3ms 2836 KiB
8 Elfogadva 3/3 3ms 3052 KiB
9 Elfogadva 4/4 3ms 3136 KiB
10 Hibás válasz 0/4 3ms 3144 KiB
11 Elfogadva 4/4 3ms 3152 KiB
12 Hibás válasz 0/7 3ms 3284 KiB
13 Hibás válasz 0/7 3ms 3292 KiB
14 Hibás válasz 0/8 3ms 3456 KiB
15 Hibás válasz 0/8 3ms 3452 KiB