#include <stdio.h>
#include <process.h>
#include <direct.h>//如果用tc编译的话头文件该为dir.h
#include <string.h>
void select()
void create_photoalbum()
{
char name[40]
int reback
scanf("%s",name)
reback=mkdir(name)
(!reback)? (printf("%s相册创建成功!\n",name)):(printf("%s相册创建失败,请查看该相册是否已经存在!\n",name))
printf("\n\n")
select()
}
void look_plist()
{
char name[40]
char path[50]={"dir "}
printf("当前您所拥有的相册!")
system("dir /a:d /w")
printf("\n请输入要查看的相册名称:\n")
scanf("%s",name)
strcat(path,name)
system(path)
printf("\n\n")
select()
}
void look_somep()
{
char name[40]
char pa[60]
printf("请输入相册名称及图片名称\n例如:fly i.jpg\n")
scanf("%s %s",pa,name)
strcat(pa,"\\")
strcat(pa,name)
system(pa)
printf("\n\n")
select()
}
void delete_pica()
{
char album[30]
char path[50]={"rmdir /s "}
printf("输入要删除的相册名称:\n")
scanf("%s",album)
strcat(path,album)
system(path)
printf("\n\n")
select()
}
void delete_pic()
{
char album[50]
char picture[30]
printf("请输入相册名称及图片名称\n例如:fly i.jpg\n")
scanf("%s %s",album,picture)
strcat(album,"\\")
strcat(album,picture)
(!remove(album))? printf("文件删除成功!") : printf("查看相册名称及图片名称是否正确!")
printf("\n\n")
select()
}
void wrong_input()
{
printf("非法输入,请重新输入!")
select()
}
void select()
{
int select
printf("1、创建相册请输入1\n2、查看相册请输入2\n3、查看具体图片请输入3\n4、删除相册请输入4\n5、删除图片请输入5\n6、退出程序请输入6\n")
scanf("%d",&select)
switch (select)
{
case 1:
create_photoalbum()
case 2:
look_plist()
case 3:
look_somep()
case 4:
delete_pica()
case 5:
delete_pic()
case 6:
exit(0)
default :
wrong_input()
}
}
void main()
{
select()
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)