-
private static int find(int num)int max = num[0];
for(int i = 0;i < i++)if(max < num[i])
max = num[i];
- The one above is the find method ---
static void main(string args)int num = new int[10];
int max = 0;
for(int i = 0;i < 10;i++)"Please enter section" + i+1) +"Number:");
num[i] = ;
max = find(num)
The maximum number is:" + max);
- This is the main method ---
ps: Because I knocked on it directly, there may be some messy places, but the main body ** should be not wrong, the parameter in the main method is the real parameter, the parameter in the find method is the form parameter, this is a reference pass, I hope to understand that ha, min is the same reason.
-
As soon as you start learning, you can get some simple sprinkles.
This app involves 3 parts.
1 Console input and output.
Commonly used: Output strings, numbers, and other objects.
It's the function above, and then switch to the next line.
Read the next character.
Read the entered line of text (this is a useful point).
2 Convert strings to numbers (e.g. to integers).
c conversion is more regular.
It's the type name. parse(string).
For example, integers are"1234"The result is 1234.
3 Find the largest and smallest numbers of the array.
If you use this a lot and program more, it will naturally be.
Give a simple example.
int ary = new int
int max = ary[0];
int min = ary[0];
for (int i = 1; i < i++)if (ary[i] >max)
max = ary[i];
if (ary[i] min = ary[i];
You see, that's pretty much it.
-
Bubbling it, take it directly from [0] after it is discharged, depending on how you dispense it.
0x ??? appearsThe 0x ??? referenced by the directiveMemory. The memory cannot be"read"or"written"。 >>>More
The bottom line of your question is one: I'm worried that my girlfriend's family won't mention the dowry again in two years! >>>More
First of all, after booting up, press a certain piece, generally the boot will be displayed, select the boot boot address, or you enter the BIOS to change to boot from the optical drive first. Put the disk into the optical drive and reboot,That's it,Follow the prompts,Install it will let you format the C disk,Then the system can be installed on the C disk,Only the things of the C disk will be deleted,So be sure to do a good job of the C disk backup before installation。 >>>More
Huh, 1. That short name cannot be changed unless you create a new account in your own name. >>>More
1。You install the new version of the motherboard driver. >>>More