fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.  
  8.  
  9. //variables
  10. int person1=0;
  11. int person2=0;
  12. int person3=0;
  13. int person4=0;
  14. int person5=0;
  15. int person6=0;
  16. int person7=0;
  17. int person8=0;
  18. int person9=0;
  19. int person10=0;
  20. //output message
  21. cout<<"Enter the number of pancakes eaten by 10 different people."<<endl;
  22.  
  23. //create a list of the people
  24. cin>>person1;
  25. cin>>person2;
  26. cin>>person3;
  27. cin>>person4;
  28. cin>>person5;
  29. cin>>person6;
  30. cin>>person7;
  31. cin>>person8;
  32. cin>>person9;
  33. cin>>person10;
  34.  
  35. //make program analyze the data and output who ate the most pancakes
  36. if(person1>person2&&person3&&person4&&person5&&person6&&person7&&person8&&person9&&person10)
  37. {
  38. cout<<"Person 1 ate the most pancakes."<<endl;
  39. }
  40. else if (person2>person3&&person4&&person5&&person6&&person7&&person8&&person9&&person10)
  41. {
  42. cout<<"Person 2 ate the most pancakes."<<endl;
  43. }
  44.  
  45. return 0;
  46. }
Success #stdin #stdout 0s 3144KB
stdin
10 9 8 7 6 5 4 3 2 1
stdout
Enter the number of pancakes eaten by 10 different people.
Person 1 ate the most pancakes.