import java.util.Scanner;
public class C1_02156213
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
//輸入三個數字
System.out.println("請輸入第一個數:");
double a = input.nextDouble();
System.out.println("請輸入第二個數:");
double b = input.nextDouble();
System.out.println("請輸入第三個數:");
double c = input.nextDouble();
//比較大小並印出結果
if( a<b && a<c && b<c)
{
System.out.println(a);
System.out.println(b);
System.out.println(c);
}
if( b<a && b<c && a<c)
{
System.out.println(b);
System.out.println(a);
System.out.println(c);
}
if( c<a && c<b && a<b)
{
System.out.println(c);
System.out.println(a);
System.out.println(b);
}
if( a<b && a<c && c<b)
{
System.out.println(a);
System.out.println(c);
System.out.println(b);
}
if( b<a && b<c && c<a)
{
System.out.println(b);
System.out.println(c);
System.out.println(a);
}
if( c<a && c<b && b<a)
{
System.out.println(c);
System.out.println(b);
System.out.println(a);
}
}
}
2014年12月23日 星期二
java程式設計題目---數字處理【大小排序(小至大)】
設計一個程式,提示使用者輸入三個數值,將此三個數值由小至大排列後,由螢幕輸出。
訂閱:
張貼留言 (Atom)
Go(Golang)程式語言 設定GCC
下載MSYS2: https://www.msys2.org/ 安裝 程式開始執行後輸入: pacman -Syu y y 在安裝目錄底下找到msys2.exe,雙擊執行 輸入指令: pacman -Su pacman -S --needed base-devel mingw-...
-
MNIST手寫數字辨識資料集 MNIST手寫數字辨識資料集 ,是由 Yann LeCun(揚·勒丘恩) 大神所蒐集,這位大神同時也是Convulution Nueral Networks(卷積神經網絡)的創始人,因此享有"卷積網絡之父"的美譽。關於這位大...
-
Write a program that reads an integer between 100 and 999, and show the result of the sum, product and difference of all its digits. For ex...
-
第一章 二、效能與效率有何區別 ? 效能 : 作對的事情 效率 : 把事情做對 五、管理程序包括哪四項管理職能 ? 規劃、組織、領導、控制 六、管理者所扮演的色有哪些 ? 人際角色 : 頭臉人物、領導者、聯絡人 資訊角色 : 監控者、傳播者、發言人...
沒有留言:
張貼留言