Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int a = 1;
- int b = 3;
- int c = -4;
- int d = -2;
- int e = -1;
- int[] arr = { a, b, c, d, e };
- // Console.WriteLine(arr.Length);
- for (int i=0; i<=arr.Length-1; i++)
- {
- if (arr[0] + arr[i+1] == 0)
- {
- if (arr[i+1] >= arr[arr.Length-1])
- {
- // arr[i + 1] = arr[arr.Length - 1];
- break;
- }
- Console.WriteLine("{0} + {1} = 0", arr[0], arr[i + 1]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement