FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Algorithms-Java/src/MinMax.java at master · professorDeveloper/Algorithms-Java · GitHub
professorDeveloper
/
Algorithms-Java
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
1
Star
16
Code
Issues
1
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Algorithms-Java
/
src
/
MinMax.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
26 lines (25 loc) · 616 Bytes
Breadcrumbs
Algorithms-Java
/
src
/
MinMax.java
Copy path
File metadata and controls
26 lines (25 loc) · 616 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import
java
.
util
.
Scanner
;
public
class
MinMax
{
public
static
void
main
(
String
[]
args
) {
Scanner
scanner
=
new
Scanner
(
System
.
in
);
int
i
;
int
n
;
int
r
;
int
min
=
0
;
int
minnum
=
0
;
// 3 5 2 4 1
System
.
out
.
println
(
"N:"
);
n
=
scanner
.
nextInt
();
//
for
(
i
=
1
;
i
<=
n
; ++
i
) {
System
.
out
.
print
(
i
+
"-"
);
r
=
scanner
.
nextInt
();
//
if
((
r
<
min
) || (
i
==
1
)) {
min
=
r
;
minnum
=
i
-
1
;
}
}
System
.
out
.
println
(
"Minimum:"
+
minnum
);
}
}
Back
|
FazBrowse Home
|
New Git URL