15,959,717 members
See more:
hi , its my program which doing sort .... in need enter input 10 numbers in a line ... how is it possible ... many thanks for ur helping :)
C#
```using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int [] a = new int [10];
int i,j,t;
Console.WriteLine("Enter 10 numbers Before Sort= ");

for (i = 0; i < 10; i++)
a[i] = Convert.ToInt32(Console.ReadLine());   //here i need help plz??
for (i = 0; i < 10; i++)
for (j = 0; j < 9; j++)
{
if (a[j] < a[j + 1])
{
t = a[j];
a[j] = a[j + 1];
a[j + 1] = t;

}

}
Console.Write("After Sort = ");
for (i = 0; i < 10; i++)
Console.Write(a[i] + " , " );

}
}
}```
Posted
[no name] 14-Jul-13 13:28pm
"here i need help plz?"... okay.... and what kind of help is it that you need?
Lida Zareian 14-Jul-13 13:32pm
how can i enter some numbers by console.readline() in a line like "5,6,7,8,..." not type any numbers in seprate line like "5
6
7
8 " ?

[no name] 14-Jul-13 13:33pm
Well get rid of the for loop and call ReadLine once. You can type all of your number in all at the same time.

## Solution 1

Hi

```for (i = 0; i < 10; i++)
a[i] = Convert.ToInt32(Console.Read());   //here i need help plz??```

Now, You can enter 10 numbers in bellow structure and enter Enter Key in end of list.
1 2 3 4 5 6 7 8 9 10 Now Press Enter

I hope It's helpful for you

Lida Zareian 14-Jul-13 13:40pm
so helpful .... many thanks friend :)
Reza Alipour Fard 14-Jul-13 14:06pm
Welcome, I hope you will be success in your life. Best Regards