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

cort

Активный
Автор темы
275
79
Здрасьте всем! написал на c++ тренер капчи для намальск рп.


C++:
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <Windows.h>

using namespace std;

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

int main() {
    srand(time(0));
    cout << "quwin clan!\n";
    while (true) {
        string captcha = generateCaptcha();
        cout << "\nCaptcha: " << 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 << " seconds" << endl;
        }
        else {
            cout << "Incorrect characters entered." << endl;
        }
    }
    return 0;
}

Приятного использования
 

Вложения

  • capha.exe
    114 KB · Просмотры: 57

Digger Man

Любитель Linux
Модератор
1,636
1,116
Ты просто написал генератор случайных значений и пару строчек кода, которые выводят время, вери юзлесс
 
  • Нравится
  • Ха-ха
Реакции: Savok, Z3roKwq и ARMOR

Тугарин Змей

Потрачен
100
61
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Здрасьте всем! написал на c++ тренер капчи для намальск рп.


C++:
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <Windows.h>

using namespace std;

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

int main() {
    srand(time(0));
    cout << "quwin clan!\n";
    while (true) {
        string captcha = generateCaptcha();
        cout << "\nCaptcha: " << 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 << " seconds" << endl;
        }
        else {
            cout << "Incorrect characters entered." << endl;
        }
    }
    return 0;
}

Приятного использования
1678203370760.png
38851316e0bdd5b17c906f0a605c9ade.jpg
 

Digger Man

Любитель Linux
Модератор
1,636
1,116
  • Нравится
Реакции: Тугарин Змей

Тугарин Змей

Потрачен
100
61
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.