剩余文件数目

来源:互联网 发布:java编程心得体会 编辑:程序博客网 时间:2024/05/29 02:24
#include <iostream>
using namespace std;


int main()
{
char strOperation[10]={0};
int num;
int count=0;


while(cin>>strOperation)
{
if(strcmp(strOperation,"binding")==0)
{
cin>>num;
count=count+num;
}
else if (strcmp(strOperation,"remove")==0)
{
cin>>num;
count=count-num;
}
else
break;


}


if (num<0)
{
cout<<"current"<<" "<<0<<endl;
}
else
cout<<"current"<<" "<<num<<endl;



return 0;
}

0 0