Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[] arr2 = new int[8] { 10, 9, 8, 9, 7, 6, 11, 5 };
- int temp2 = 0;
- for (int i = 1; i <= arr2.Length - 1; i++)
- {
- for (int j = i - 1; j <= arr2.Length - 1; j++)
- {
- if (arr2[j] > arr2[i])
- {
- temp2 = temp2 + arr2[i]+arr2[j];
- }
- }
- }
Add Comment
Please, Sign In to add comment