Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- double mx = 0;
- int n, mxIndex = 0;
- cin >> n;
- int a[n * 3];
- for(int i = 0; i < n * 3; i++){
- cin >> a[i];
- }
- for(int i = 0; i < n * 3; i += 3){
- double r = sqrt(a[i] * a[i] + a[i + 1] * a[i + 1] + a[i + 2] * a[i + 2]);
- if(r > mx){
- mx = r;
- mxIndex = i;
- }
- }
- cout << (mxIndex / 3) + 1 << ") " << a[mxIndex] << " " << a[mxIndex + 1] << " " << a[mxIndex + 2];
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement