fojtasd

Untitled

Jan 18th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8. const int N = 5;
  9. int A[N] = { 5, 9, 3, 2, 8 };
  10. int B[N] = { 20, 15, 14, 22, 11 };
  11. int tempA = A[0];
  12. int tempB = B[0];
  13.  
  14. for (int i = 0; i < N; i++) {
  15. for (int j = 0; j < N; j++){
  16. if (A[i] > A[j]) {
  17. tempA = A[i];
  18. }
  19.  
  20. }
  21.  
  22. }
  23.  
  24. cout << tempA << endl;
  25.  
  26. system("pause");
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36. return 1;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment