#include<stdlib.h>
#include<stdio.h>
//用exce只能生成一个,然后退出,这不是我们想要的,所以用system
int main(int argc,char *argv[])
{
int a=0,end;
char buffer[100];
end=atoi(argv[1]);//第二个参数字符串转化为数字,表示要创建的文件数目
printf("form 0 to %d\n",end-1);//输出需要创建的文件数目
for(a=0;a<end;a++)
{
sprintf(buffer,"touch ZZ%d.txt",a);/*将命令打到字符串中,touch是shell中创建文件的指令*/
system(buffer);//执行指令,创建从“ZZ0”到“ZZ(输入数字减一)”的文件夹
}
return 0;
}