Софтуерно Инженерство
Loading...
+ Нов въпрос
LoshaPanda avatar LoshaPanda 5 Точки

C++ Generator for passwords

Здравейте,

Направих задачата , но може би има и по-рационален начин. Може ли да видя как вие сте я направили ?

Кода ми:

 

#include <iostream>
#include <string>

using namespace std;

int main()
{

    int k = 0, x, m = 0; bool quit = false;;

    cin >> x;

    for (int n = 1111; n <= 9999; n++)
    {
        for (int i = 0; i < 4; i++)
        {
            string a = to_string(n);

            char ch = a[i] - 48;
            int digit = ch;
            
            if (a[i + 1] - 48 == 0)
            {
                digit = (a[i] - 48) * 10; quit = true;
            }

            if (x % digit == 0)
            {
                k++;
            }
            if (quit)
            {
                quit = false;
                break;
            }
            m = digit;
        }
        if (k == 4)
        {
            cout << n << " ";
        }
        k = 0;
    }

}

 

Тагове:
0
C++ Programming
KaiFouch avatar KaiFouch 0 Точки

In my opnion, you have done a great job because as we have known that coding is not easy for everyone you have to do hard work and also you can hire top linkedin profile writers to write your thoughts easily. The solutions are quite well and keep it up share more like this.

-1
KaiFouch avatar KaiFouch 0 Точки

C++ generator is the best option for the safe recovery of the passwords and other issues related to the passwords. Also you can get great casino games from https://porncasino.co/playboy-slots/ to enjoy in your free time. Goos to know that the software University has introduced this blog and forum for us and providing these to us.

0