Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- bool hasTriangles(double arr1[],double arr2[], double arr3[], int n)
- {
- for (int i = 0; i < n; i++)
- {
- for (int j = 0; j < n; j++)
- {
- for (int r = 0; r < n; r++)
- {
- if(arr1[i] > arr2[j] && arr1[i] > arr3[r])
- {
- if(arr1[i]*arr1[i] == arr2[j]*arr2[j] + arr3[r]*arr3[r])
- {
- return 1;
- }
- }else if(arr2[j] > arr1[i] && arr2[j] > arr3[r])
- {
- if(arr2[j]*arr2[j] == arr1[i]*arr1[i]+ arr3[r]*arr3[r])
- {
- return 1;
- }
- }else if(arr3[r] > arr1[i] && arr3[r] > arr2[j])
- {
- if(arr3[r]*arr3[r] == arr1[i]*arr1[i]+ arr2[j]*arr2[j])
- {
- return 1;
- }
- }
- }
- }
- }
- return 0;
- }
- int main()
- {
- int n;
- cin >> n;
- double arr1[100] = {1, 5, 3};
- double arr2[100] = {2, 4};
- double arr3[100] = {6, 3, 0};
- cout << hasTriangles(arr1, arr2, arr3, n);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement