Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- int[] a = new int[10];
- int[] b = new int[a.Length];
- int[] c = new int[a.Length];
- int i, j, Placement = 0, x, f, y, car, bar, aar;
- for (i = 0; i < a.Length; i++)
- {
- a[i] = int.Parse(Console.ReadLine());
- }
- for (j = 0; j < a.Length; j++)
- {
- if (a[j] < 0)
- {
- b[Placement] = a[j];
- Placement++;
- }
- }
- for (x = 0; x < a.Length; x++)
- {
- if (a[x] > 0)
- {
- b[Placement] = a[x];
- Placement++;
- }
- }
- for (f = 0; f < a.Length; f++)
- Console.Write(b[f] + " ");
- for (y = 0; y < a.Length; y++)
- {
- if (a[y] > b[y])
- {
- c[y] = a[y];
- }
- else if (b[y] > a[y])
- {
- c[y] = b[y];
- }
- else
- {
- c[y] = 0;
- }
- }
- Console.WriteLine("");
- for (car = 0; car < a.Length; car++)
- Console.Write(a[car] + " ");
- Console.WriteLine("");
- for (bar = 0; bar < a.Length; bar++)
- Console.Write(b[bar] + " ");
- Console.WriteLine("");
- for (aar = 0; aar < a.Length; aar++)
- Console.Write(c[aar] + " ");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement