#include <iostream>
using namespace std;
class Store
{
public:
int itemcount(int id)
{
cout<<id;
}
int itemcount(int totalavl,int remaining)
{
int a;
a=totalavl-remaining;
cout<<"\n"<<a;
}
};
int main()
{
int a,b,id;
cin>>id>>a>>b;
Store ob;
ob.itemcount(id);
ob.itemcount(a,b);
return 0;
}
using namespace std;
class Store
{
public:
int itemcount(int id)
{
cout<<id;
}
int itemcount(int totalavl,int remaining)
{
int a;
a=totalavl-remaining;
cout<<"\n"<<a;
}
};
int main()
{
int a,b,id;
cin>>id>>a>>b;
Store ob;
ob.itemcount(id);
ob.itemcount(a,b);
return 0;
}
not working
ReplyDeleteany test case
#include
ReplyDeleteusing namespace std;
class Store
{
public:
int itemcount(int id)
{
return id;
}
int itemcount(int totalavl,int consumed)
{
return totalavl-consumed;
}
};
int main() {
int id,a,b;
int item,lol;
cin>>id>>a>>b;
Store ob;
item=ob.itemcount(id);
cout<<item<<endl;
lol=ob.itemcount(a,b);
cout<<lol;
return 0;
}