Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. class Program
  2. {
  3. static int[] someArray = new int[] { 6777, 6666, 6653, 6666 };
  4. static void Sort(int[] array)
  5. {
  6. for (int i = 0; i < array.Length; i++)
  7. {
  8. if (array[i] > array[array.Length - 1])
  9. {
  10. int temp = array[i];
  11. array[i] = array[array.Length - 1];
  12. array[array.Length - 1] = temp;
  13. }
  14. }
  15. foreach (var item in array)
  16. Console.WriteLine(item);
  17. Console.ReadKey();
  18. }
  19. static void Main(string[] args)
  20. {
  21. Sort(someArray);
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement