Samper_Sampovskiy
Участник
- 47
- 17
1. Человек сделал как удобнее. Хоть на паскале такое можно сделатьможно же такую же фигню сделать на vbs смысл на exe ?
научину генерацию картинки как на намальске, гораздо больший буст даст тебе, чем вывод в консоль
гугл и правильные вопросы) По приколу можешь сделать рендер картинок на ascii символах или буквах, но это извратнаучи
хз, мне лично там на vbs легче написать скриптик, Чем exe делать, Но это его мнение.1. Человек сделал как удобнее. Хоть на паскале такое можно сделать
2. VBS еще не сдох?
#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; }
ОГОТолько цифры
исх:#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; }