Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include<string>
  2. #include<iostream>
  3. #include<memory>
  4.  
  5. using namespace std;
  6.  
  7. struct Cookie{
  8. string type;
  9. Cookie():type("Dough"){
  10. cout<<"Doughprepared"<<endl;
  11. }
  12. Cookie(const string &type):type(type){
  13. cout<<type<<"baked"<<endl;
  14. }
  15. ~Cookie(){
  16. cout<<type<<"vanished"<<endl;
  17. }
  18. };
  19.  
  20. Cookie*mix(const Cookie* box1,int num1,
  21. const Cookie* box2,int num2){
  22. Cookie*kmix=new Cookie[num1+num2];
  23. for(int i=0;i<num1;++i)kmix[i]=box1[i];
  24. for(int i=0;i<num2;++i)kmix[i+num1]=box2[i];
  25. return kmix;
  26. }
  27.  
  28. bool nobodyEatsCookies(Cookie* bowl)
  29. {
  30. return false;
  31. }
  32.  
  33. bool meeting(){
  34. Cookie box1[]={Cookie("Bisquit"),Cookie("Chocolate")};
  35. Cookie box2[]={Cookie("Acacookie")};
  36. Cookie*bowl=mix(box1,2,box2,1);
  37. if(nobodyEatsCookies(bowl))
  38. return false;
  39. delete bowl;
  40. return true;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement