给大家分享我制作的名单系统(十分简陋
#include<iostream>
using namespace std;
int main()
{
cout<<"人物名单1.0"<<endl;
int a,b,c=0,d,e,f;
string name[100],juese;
b=0;
while(d=1)
{
cout<<"查询人物请按2,添加人物请输入1,减少人物输入0"<<endl;
cout<<"输入:";
cin>>a;
if(a==0)
{
cout<<"--------------------"<<endl;
if(b=0)
{
cout<<"无角色";
}
cout<<"输入编号:";
cin>>e;
if(c<e)
{
cout<<"错误"<<endl;
}
else
{
for(f=b;f=b;f=f+0)
{
name[f-1]=name[99];
}
c--;
cout<<"执行成功"<<endl;
}
f=0;
e=0;
a=2;
cout<<"--------------------"<<endl;
}
if(a==1)
{
cout<<"--------------------"<<endl;
cout<<"输入角色:";
cin>>juese;
name[c]=juese;
c++;
a=0;
cout<<"执行成功"<<endl;
cout<<"--------------------"<<endl;
}
if(a==2)
{
if(c!=0)
{
cout<<"--------------------"<<endl;
for(f=0;f<c;f++)
{
cout<<f+1<<":"<<name[f]<<endl;
}
cout<<"执行成功"<<endl;
cout<<"--------------------"<<endl;
}
if(c==0)
{
cout<<"--------------------"<<endl;
cout<<"无角色"<<endl;
cout<<"--------------------"<<endl;
}
}
}
}
这个“工具”有些问题,大家如果有什么报错的话可以私信我。