151342025-02-13 11:51:05tamasmarkA sárkány feladványa (50)cpp17Hibás válasz 0/502ms512 KiB
// sarkany.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;
            int d;
int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    cout << 1400 << "\n";
    cin >> a >> b >> c;
    cout << -1 << "\n";
    cin >> a >> b >> c;
    if (a % b == 0)
    {
        for (int i = 1; i <= c; ++i)
            cout << a;

    }
    else if(b%a==0)
    {
        for (int i = 1; i <= c; ++i)
            cout << b;
    }
    else
    {
        if (a * b > pow(10, c))
        {
            cout << -1;
        }
        else
        {
            //cout << a * b;
            int n = a * b;

            while (n > 0)
            {
                d++;
                n = n/10;
            }
            cout << (a * b) * pow(10, c - d);
        }
    }
    return 0;
}
/*
2 7 4
26 11 2
3 9 22
*/
// 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
base0/50
1Elfogadva0/01ms316 KiB
2Hibás válasz0/01ms512 KiB
3Hibás válasz0/31ms316 KiB
4Hibás válasz0/31ms316 KiB
5Hibás válasz0/31ms316 KiB
6Hibás válasz0/31ms316 KiB
7Hibás válasz0/31ms316 KiB
8Hibás válasz0/31ms316 KiB
9Hibás válasz0/31ms316 KiB
10Hibás válasz0/31ms404 KiB
11Hibás válasz0/31ms316 KiB
12Hibás válasz0/31ms316 KiB
13Hibás válasz0/42ms316 KiB
14Hibás válasz0/42ms316 KiB
15Hibás válasz0/42ms316 KiB
16Hibás válasz0/41ms316 KiB
17Hibás válasz0/41ms316 KiB