Advertisement
minhnhatisme

Untitled

Apr 10th, 2020
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. //Exercise 1
  6. /*int main()
  7. {
  8.     int array[6] = { 1, 2, 3, 4, 10, 11 };
  9.     int sum = 0;
  10.     for (int i = 0; i < 6; i++)
  11.     {
  12.         sum = sum + array[i];
  13.     }
  14.     cout << sum << endl;
  15.     system("PAUSE");
  16.     return 0;
  17. }*/
  18.  
  19. //Exercise 2
  20. /*int main()
  21. {
  22.     int bobPoint = 0, alicePoint = 0;
  23.     int bobValue[3] = { 5, 6, 7 };
  24.     int aliceValue[3] = { 3, 6, 10 };  
  25.     for (int count = 0; count < 3; count++)
  26.     {
  27.         if (bobValue[count] < aliceValue[count])
  28.         {
  29.             bobPoint += 1;
  30.         }
  31.         if (bobValue[count] > aliceValue[count])
  32.         {
  33.             alicePoint += 1;
  34.         }
  35.     }
  36.     cout << "Point of Bob : " << bobPoint << endl;
  37.     cout << "Point of Alice : " << alicePoint << endl;
  38.     system("PAUSE");
  39.     return 0;
  40. }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement