fork download
  1. // Ex1.cpp.cpp : Defines the entry point for the console application.
  2. //
  3. #include"stdafx.h"
  4. #include<iostream>
  5. using namespace std;
  6.  
  7. class Ex1
  8. {
  9. int peppermint, wrappers = 0, day = 0, n1, i;
  10. public:
  11. void getdata()
  12. {
  13. cout << "Enter The NO. Of Peppermints left and Wrappers::";
  14. cin >> peppermint >> wrappers;
  15. }
  16. void calculatep()
  17. {
  18.  
  19. if (peppermint != 0)
  20. {
  21. if (wrappers % 7== 0)
  22. {
  23. peppermint = peppermint + (wrappers / 7);
  24. }
  25. for (i = peppermint;i >= peppermint;i--)
  26. {
  27. wrappers = wrappers + i;
  28. day = day + i;
  29.  
  30. }
  31. cout << "The Days are ::" << day << endl;
  32. }
  33. }
  34.  
  35. };
  36.  
  37.  
  38.  
  39. int main()
  40. {
  41. Ex1 ex;
  42. ex.getdata();
  43. ex.calculatep();
  44. return 0;
  45.  
  46. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
p 
papagaio
compilation info
prog.cpp:3:19: fatal error: stdafx.h: No such file or directory
 #include"stdafx.h"
                   ^
compilation terminated.
stdout
Standard output is empty