如何在不会c++的朋友面前伪装黑客?
下方代码拿去不谢
#include<conio.h>
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
void HideCursor(){
CONSOLE_CURSOR_INFO cursor_info = {1, 0};
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);
}
int main(){
HideCursor();
system("title Fake Hacker");
string code[150] = {"#include<iostream>",
"using namespace std;",
"int main() {",
" int i;",
" int arr[10] = { 1,5,2,3,6,8,7,9,4,0};",
" for (int i = 0; i < 9;i++) {",
"",
" for (int j = 0; j < 9-i; j++) {",
" if (arr[j]>arr[j + 1]) {",
" int temp = arr[j + 1];",
" arr[j + 1] = arr[j];",
" arr[j] = temp;",
" }",
" }",
" for (int j = 0; j < 10; j++){",
" cout << arr[j] << endl;",
" }",
" system('pause');",
" return 0;",
"}",
"",
"",
"",
"#include<iostream>",
"#include<stack>",
"using namespace std;",
"int main(){",
" long long n;",
" int base = 16;",
" cin >> n;",
" stack<char>S;",
" char a[] = '4934ACE';",
" if(n==0) S.push(a[0]);",
" while(n>0){",
" S.push(a[n%base]);",
" n /= base;",
" }",
" while(!S.empty()){",
" cout << S.top();",
" S.pop();",
" }",
"}",
"#include<bits/stdc++.h>",
"using namespace std;",
"int main(){",
"int n,a = 1,b = 1,c;",
"cin >> n;",
"if(n == 1||n == 2){",
" cout << '1';",
"}else{",
" for(int i = 0;i < n;i++){",
" c = a + b;",
" a = b;",
" b = c;",
" }",
" cout << c;",
"}",
"return 0;",
"}",
"",
"",
"#include <iostream> ",
"#include <cmath> ",
"",
"using namespace std; ",
"",
"int main() { ",
" char op; ",
" double num1, num2, result; ",
"",
" cin >> op;",
" cin >> num1 >> num2;",
"",
" switch (op) {",
" case '+':",
" result = num1 + num2;",
" break; ",
" case '-':",
" result = num1 - num2;",
" break; ",
" case '*': ",
" result = num1 * num2;",
" break; ",
" case '/': ",
" if (num2 != 0) { ",
" result = num1 / num2; ",
" } else { ",
" return 1; ",
" } ",
" break; ",
" case '^': ",
" if (cin.get() == '^') { ",
" result = pow(num1, 3); ",
" } else { ",
" result = pow(num1, 2); ",
" } ",
" cin.ignore(); ",
" break; ",
" default: ",
" return 1; ",
" } ",
" cout << result << endl; ",
" return 0; ",
"}"
};
//上面为输出的字符,可修改
int nums = 103;//输出行数,是最后一行所在行数-第一行所在行数
system("color");
system("mode con cols=125 lines=40");
SetWindowLongPtrA(GetConsoleWindow(), GWL_STYLE, GetWindowLongPtrA(GetConsoleWindow(),GWL_STYLE)& ~WS_SIZEBOX & ~WS_MAXIMIZEBOX & ~WS_MINIMIZEBOX);
string temp;
char ch1;
char ch2;
char ch3;
char ch4;
char ch5;
cout<<"\033[1;32m"<<""<<"\033[1;32m"; //green绿色
// cout<<"\033[31m"<<""<<"\033[31m"; //red红色
// cout<<"\033[1;36m"<<""<<"\033[1;36m"; //cyan青色
// cout<<"\033[1;33m"<<""<<"\033[1;33m"; //yellow黄色
while(true){
for(int i = 0;i <= nums;i++){
temp = code[i];
for(int j = 0;j <= temp.size();j += 5){
while (!kbhit()) {
}
getch();
if(j <= temp.size()){
ch1 = temp[j];
cout << ch1;
if(j + 1 <= temp.size()){
ch2 = temp[j+1];
cout << ch2;
if(j + 2 <= temp.size()){
ch3 = temp[j+2];
cout << ch3;
if(j + 3 <= temp.size()){
ch4 = temp[j+3];
cout << ch4;
if(j + 4 <= temp.size()){
ch5 = temp[j+4];
cout << ch5;
}
}
}
}
}
}
cout << endl;
}
}
}
使用说明:
按键盘就行了