Тренер капчи на c++

cort

Активный
Автор темы
275
79
есть скрин как выглядит там пикча или че там
1678462019923.png
 

genius.company

Известный
594
271
Только цифры

исх:
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <Windows.h>

using namespace std;

string generateCaptcha() {
    string choices = "1234567890";
    string captcha;
    for (int i = 0; i < 5; i++) {
        int r = rand() % choices.size();
        captcha += choices[r];
    }
    return captcha;
}

int main() {
    srand(time(0));
    while (true) {
        string captcha = generateCaptcha();
        cout << "Captcha: " << captcha << endl;
        clock_t start_time = clock();
        string result;
        cin >> result;
        if (result == captcha) {
            double elapsed_time = double(clock() - start_time) / CLOCKS_PER_SEC;
            cout << "You entered the captcha in " << elapsed_time << " sec" << endl;
        }
        else {
            cout << "Incorrect characters entered." << endl;
        }
    }
    return 0;
}
 

Вложения

  • 1.exe
    490.3 KB · Просмотры: 5

cort

Активный
Автор темы
275
79
Только цифры

исх:
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <Windows.h>

using namespace std;

string generateCaptcha() {
    string choices = "1234567890";
    string captcha;
    for (int i = 0; i < 5; i++) {
        int r = rand() % choices.size();
        captcha += choices[r];
    }
    return captcha;
}

int main() {
    srand(time(0));
    while (true) {
        string captcha = generateCaptcha();
        cout << "Captcha: " << captcha << endl;
        clock_t start_time = clock();
        string result;
        cin >> result;
        if (result == captcha) {
            double elapsed_time = double(clock() - start_time) / CLOCKS_PER_SEC;
            cout << "You entered the captcha in " << elapsed_time << " sec" << endl;
        }
        else {
            cout << "Incorrect characters entered." << endl;
        }
    }
    return 0;
}
Только цифры

исх:
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <Windows.h>

using namespace std;

string generateCaptcha() {
    string choices = "1234567890";
    string captcha;
    for (int i = 0; i < 5; i++) {
        int r = rand() % choices.size();
        captcha += choices[r];
    }
    return captcha;
}

int main() {
    srand(time(0));
    while (true) {
        string captcha = generateCaptcha();
        cout << "Captcha: " << captcha << endl;
        clock_t start_time = clock();
        string result;
        cin >> result;
        if (result == captcha) {
            double elapsed_time = double(clock() - start_time) / CLOCKS_PER_SEC;
            cout << "You entered the captcha in " << elapsed_time << " sec" << endl;
        }
        else {
            cout << "Incorrect characters entered." << endl;
        }
    }
    return 0;
}
ОГО