114752024-10-04 11:43:51eokorBimmbamm (30)cpp14Elfogadva 30/303ms616 KiB
// gyereram.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <string>


using namespace std;


int main()
{
    //ifstream fin("be.txt");
    /*cout << "Hello World!\n";
    map<string, int> alma = { {"huss",1}, {"piff", 2}};
    for (auto i = alma.begin(); i != alma.end(); i++)
    {
        cout << i->first << " " << i->second;
    }
    int r = rand();
    int n=2;
    vector <vector<int>> korte(n,vector<int>(15));
    vector <vector<int>> k(n, vector<int>(15));
    k = korte;
    for (int i = 0; i < k.size(); i++)
    {
        for (int j = 0; j < k[i].size(); j++)
            cout << k[i][j]<<" ";
        cout << endl;
    }*/

    string a,e;
    int db = 1;
    bool helyes = 1;
    int maxi;
    cin >> maxi;

    while (cin>>a && helyes)
    {
        if (db % 3 != 0)
        {
            if (db % 5 != 0)
            {       if (a != "SZAM")
                {
                    helyes = 0;
                }
            }
            else if (a!= "BAMM")
                {
                    helyes = 0;
                }
        }
        else {
            if (db % 5 != 0)
            {
                if (a != "BIMM")
                    helyes = 0;
            }
            else if (a != "BUMM")
                helyes = 0;
        }
        if(helyes)
            db++;
    }
    if (!helyes)
        cout << db;
    else cout << 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ÖsszpontTesztVerdiktIdőMemória
base30/30
1Elfogadva0/03ms488 KiB
2Elfogadva0/03ms360 KiB
3Elfogadva3/32ms360 KiB
4Elfogadva3/33ms296 KiB
5Elfogadva3/32ms360 KiB
6Elfogadva3/33ms384 KiB
7Elfogadva3/33ms616 KiB
8Elfogadva3/32ms376 KiB
9Elfogadva3/32ms232 KiB
10Elfogadva3/33ms384 KiB
11Elfogadva3/33ms360 KiB
12Elfogadva3/32ms504 KiB