| |

VerySource

 Forgot password?
 Register
Search
View: 1376|Reply: 5

How to take the largest value among 1, 2, 3, 4, and 5?

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-12-17 01:30:01
| Show all posts |Read mode
How to take the largest value among 1, 2, 3, 4, and 5?
Reply

Use magic Report

0

Threads

14

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-12-18 18:15:02
| Show all posts
bubble
Reply

Use magic Report

0

Threads

34

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

Post time: 2020-12-18 20:30:01
| Show all posts
There should be no sorting, just one traversal
Dim a, Max, i
a = Array(1, 2, 3, 4, 5)
Max = a(0)
For i = 1 To UBound(a)
    If Max <a(i) Then Max = a(i)
Next
Print Max
Reply

Use magic Report

0

Threads

18

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-12-18 20:45:01
| Show all posts
dim max as integer
max = -1
for i = 0 to uboud(a)
  if max <a(i) then max = a(i)
next

return max
Reply

Use magic Report

0

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-12-19 11:45:01
| Show all posts
Is it necessary to use bubbling?
Reply

Use magic Report

0

Threads

9

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-12-19 21:15:01
| Show all posts
Put these values ​​in the database, a select max (example name)   from table name
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list