-
For example, compare the size of the four digits a, b, c, and d, and take xmin = the smallest number. For example: 1,2,3,4, then xmin=1;If 1, 2, 0, 3, then xmin=1, when all are 0, xmin=0
Create a new project.
Build a text1 above and then copy three,Generate a control data and then make a button,Copy the following ** on it,There is no problem with the test,dim a(4)'Define the array。
private sub command1_click()for j = 1 to 4
a(j) = text1(j - 1).text 'Here, for simplicity, I'll use the array control.
min = a(1)
flag = 1
for i = 2 to 4
a(i) = text1(i - 1).textif min > a(i) then
if min = 0 then
min = a(i)
end if
if a(i) = 0 then
min = min
end if
min = a(i)
flag = i
end if
next i
next j
msgbox min
end sub
There was no problem with the test, oh......
If you don't want to use an array of widgets, create four text boxes and write a(1) = a(2) =
-
Let the first number be minimal.
Then go to the second number, and if it's smaller than the first, then make the first number equal to this number.
And so on.
-
Hello: This is very simple, this question tests your use of the if conditional function, see below**.
Examples of correct usage:
if a > b then
A is greater than belse
b is greater than aend if
According to your requirements, you can change to the following** to achieve your requirements:
if > then
The large number is:' +
else 'The large number is:' +
end if
If you have any questions, you can continue to ask.
Hope it works for you!
-
Output Maximum:
#include
void main()
Enter three numbers (separated by spaces), compare the size of the first two numbers, assign the larger number to max, and then compare the size of max with the third number to output the larger number.
Output in descending order:
#include
void main()
elseif (max_ab <= c)
printf("%d %d %d",c,max_ab,min_ab);
else if (max_ab > c &&c >min_ab)
printf("%d %d %d",max_ab,c,min_ab);
else if (max_ab > c &&c <=min_ab)
printf("%d %d %d",max_ab,min_ab,c);
Enter three numbers, determine the first two numbers, assign the large number to max ab, the small number to min ab, and compare max ab with c. If c is greater than or equal to max ab, c, max ab, min ab. are outputIf c is less than max ab and greater than min ab, max ab, c, min ab. are output
If c is less than min ab, max ab, min ab, c are output
Knowledge extension: C language is a computer programming language, which has the characteristics of both high-level language and assembly language. It was launched in 1972 by the Bell Institute in the United States, and after 1978, the C language has been transplanted to large, medium, small and micro computers, and it can be used as a working system design language to write system applications, and it can also be used as an application design language to write applications that do not rely on computer hardware.
It has a wide range of applications, with strong data processing capabilities, not only in software development, but also all kinds of scientific research need to use C language, suitable for writing system software, three-dimensional, two-dimensional graphics and animation, specific applications such as microcontroller and embedded system development.
-
Is it self-taught?
If a>b then.
max=a, otherwise max=b
In this case, max is the maximum value in a and b.
Next, just let max and c compare to get the maximum value, the specific ** is not for you, and it is better to make up your own ideas.
-
Oh, bro, it's less end if.
Complete**:
private sub command1_click()dim a,b,c as integer
a = val(
b = val(
c = val(
dim max as integer=a
if max < b then
max = b
elseif max < c then
max = c
end if
maxend sub
-
Yes, no problem.
You put the wrong number up as well.
-
Is it to find the maximum or minimum value? Or is it sorted from largest to smallest, or from smallest to largest?
Try my way:
Create a text on the form, and a command1 >>>More
Two methods:1Add an array of controls with the load method, provided you have to add a control to the form at design time and set its index property to 0, then use : >>>More
WinRAR also integrates the function of volume compression, and it does not have to be supported by floppy disks like WinZip to use this function, and can store a large file volume compression in any specified drive letter when making, so this is also greatly convenient for us to use. >>>More
Let the original number be x; After expanding by 100 times, it is x(1+100), which is larger than the original number; Therefore x(1+100)=x+ ==> x=, i.e., x=. Answer: The original number is. >>>More
I tried going downstairs with no problem. If it can't be opened, the landlord can try this sentence: (note that it is 3 quotation marks). >>>More