Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Crescente.java
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
import java.util.Scanner; public class Crescente { public static void main(String args[]) { Scanner read = new Scanner (System.in); float x,y,z; System.out.println("Insira o primeiro valor"); x= read.nextFloat(); System.out.println("Insira o segundo valor"); y= read.nextFloat(); System.out.println("Insira o terceiro valor"); z= read.nextFloat(); if (x < y) { if (y < z) { System.out.println("Em ordem Crescente:\n" +x+ "\n" +y+"\n" + z); } else if (x < z) { System.out.println("Em ordem Crescente:\n"+x+ "\n" +z+ "\n" +y ); } else { System.out.println("Em ordem Crescente:\n"+z+ "\n" +x+ "\n" +y ); } } else if (y < z) { if (x < z) { System.out.println("Em ordem Crescente:\n"+y+ "\n" +x+ "\n" +z ); } else { System.out.println("Em ordem Crescente:\n"+y+ "\n" +z+ "\n" +x ); } } else { System.out.println("Em ordem Crescente:\n"+z+ "\n" +y+ "\n" +x ); } read.close(); } }
[
+
]
Show input
edit mode
|
history
|
discussion