Advertisement
naser2345

Untitled

Sep 1st, 2020
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. /*
  2. * Q1
  3. #include <iostream>
  4. #include <cstdlib>
  5. using namespace std;
  6. int main()
  7. {
  8.  
  9. int n;cin >> n;int arr[1000][2];
  10.  
  11. for (int i = 0; i < n; i++)
  12. for (int j = 0; j < 2; j++)
  13. cin >> arr[i][j];
  14.  
  15. for (int i = 0; i < n; i++)
  16. {
  17. cout << (abs(arr[i][0]) + abs(arr[i][1])) << endl;
  18. }
  19.  
  20.  
  21. }
  22. */
  23.  
  24.  
  25. /*
  26. * Q2
  27. #include <iostream>
  28. #include <algorithm>
  29. using namespace std;
  30. int main()
  31. {
  32. int arr[1000][3];
  33. int n; cin >> n;
  34. for (int i = 0; i < n; i++)
  35. for (int j = 0; j < 3; j++)
  36. cin >> arr[i][j];
  37.  
  38. for (int i = 0; i < n; i++)
  39. cout << max(arr[i][0],max(arr[i][1], arr[i][2])) << endl;
  40.  
  41. }
  42.  
  43. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement