Home > Net >  C # project
C # project

Time:09-30

Which bosses know, why didn't after I input the number eight largest minimum, average, sum of output

CodePudding user response:

Using System. Linq;

Int a=new int [] [7] {... };
Int Max=arjun ax ();
Int min=arjun (in);
.

CodePudding user response:

I am want to input the number eight, you still won't do

CodePudding user response:

User input part is not quite right,
About this change (remember to add a namespace reference using System. The Linq) :

 static void Main (string [] args) 
{
Console. WriteLine (" please enter eight integer (separated by Spaces) : ");
The string line=Console. ReadLine ();
Int [] a=line
Split (", ". ToCharArray (), StringSplitOptions. RemoveEmptyEntries)//the open input a space
The Select (x=& gt; Int. Parse (x))//apart each string, converted to an integer corresponding
The ToArray ();//get the integer array
Int Max=a [0], min=a [0], average, sum;
for(int i=0; i {
//...
}
//...

}

CodePudding user response:

reference github_36000833 reply: 3/f
user input part is not quite right,
About this change (remember to add a namespace reference using System. The Linq) :

 static void Main (string [] args) 
{
Console. WriteLine (" please enter eight integer (separated by Spaces) : ");
The string line=Console. ReadLine ();
Int [] a=line
Split (", ". ToCharArray (), StringSplitOptions. RemoveEmptyEntries)//the open input a space
The Select (x=& gt; Int. Parse (x))//apart each string, converted to an integer corresponding
The ToArray ();//get the integer array
Int Max=a [0], min=a [0], average, sum;
for(int i=0; i {
//...
}
//...

}

谢谢大神,

CodePudding user response:

Eight Numbers you int [7]?

CodePudding user response:

Int. J tryparse one-time gain an array? Do you want to many, at least to get an array is a cycle

CodePudding user response:

refer to 6th floor caozhy response:
8 Numbers you int [7]?
almost went

CodePudding user response:

refer to 6th floor caozhy response:
8 Numbers you int [7]?
  •  Tags:  
  • C#
  • Related