標題:
資料輸入 (三)
[打印本頁]
作者:
tonyh
時間:
2021-1-22 09:12
標題:
資料輸入 (三)
import java.io.Console;
public class Ch05
{
public static void main(String args[])
{
int x, y;
Console c=System.console();
x=Integer.parseInt(c.readLine("輸入x的值: "));
y=Integer.parseInt(c.readLine("輸入y的值: "));
System.out.println("x+y="+(x+y));
System.out.println("x-y="+(x-y));
System.out.println("x*y="+(x*y));
System.out.println("x/y="+(x/y));
System.out.println("x%y="+(x%y));
}
}
複製代碼
作者:
吳聲寬
時間:
2021-1-22 09:31
import java.io.Console;
public class Ch05
{
public static void main(String args[])
{
int x,y;
Console c=System.console();
x=Integer.parseInt(c.readLine("Enter a X: "));
y=Integer.parseInt(c.readLine("Enter a Y: "));
System.out.println("x+y="+(x+y));
System.out.println("x-y="+(x-y));
System.out.println("x*y="+(x*y));
System.out.println("x/y="+(x/y));
System.out.println("x%y="+(x%y));
}
}
複製代碼
作者:
王博裕
時間:
2021-1-22 09:32
import java.io.Console;
public class Ch01
{
public static void main(String args[])
{
int x,y;
Console c=System.console();
x=Integer.parseInt(c.readLine("輸入x的值"));
y=Integer.parseInt(c.readLine("輸入y的值"));
System.out.println("x+y="+(x+y));
System.out.println("x-y="+(x-y));
System.out.println("x*y="+(x*y));
System.out.println("x/y="+(x/y));
System.out.println("x%y="+(x%y));
}
}
複製代碼
作者:
李柏穎
時間:
2021-1-22 09:33
import java.io.Console;
public class Ch01
{
public static void main(String ags[])
{
int x, y;
Console c=System.console();
x=Integer.parseInt(c.readLine("輸入x的值: "));
y=Integer.parseInt(c.readLine("輸入y的值: "));
System.out.println("x+y="+(x+y));
System.out.println("x-y="+(x-y));
System.out.println("x*y="+(x*y));
System.out.println("x/y="+(x+y));
System.out.println("x%y="+(x%y));
}
}
複製代碼
作者:
王睿宇
時間:
2021-1-22 09:33
import java.io.Console;
public class Ch01
{
public static void main(String args[])
{
int x, y;
Console c=System.console();
x=Integer.parseInt(c.readLine("輸入x的值: "));
y=Integer.parseInt(c.readLine("輸入y的值: "));
System.out.println("x+y="+(x+y));
System.out.println("x-y="+(x-y));
System.out.println("x*y="+(x*y));
System.out.println("x/y="+(x/y));
System.out.println("x%y="+(x%y));
}
}
複製代碼
作者:
紀承典
時間:
2021-1-22 09:36
本帖最後由 紀承典 於 2021-1-22 09:38 編輯
import java.io.Console;
public class Ch05
{
public static void main(String args[])
{
int x, y;
Console c=System.console();
x=Integer.parseInt(c.readline("輸入x的值"));
System.out.println("x+y="+(x+y));
System.out.println("x-y="+(x-y));
System.out.println("x*y="+(x*y));
System.out.println("x/y="+(x/y));
System.out.println("x%y="+(x%y));
}
}
複製代碼
作者:
藍健洲
時間:
2021-1-22 09:36
import java.io.Console;
public class Ch05
{
public static void main(String args[])
{
int x, y;
Console c=System.console();
x=Integer.parseInt(c.readLine("請輸入x的值: "));
y=Integer.parseInt(c.readLine("請輸入y的值: "));
System.out.println("x+y="+(x+y));
System.out.println("x-y="+(x-y));
System.out.println("x*y="+(x*y));
System.out.println("x/y="+(x/y));
System.out.println("x%y="+(x%y));
}
}
複製代碼
作者:
楊小萱
時間:
2021-1-22 09:37
import java.io.Console;
public class Ch05
{
public static voiid main(String args[])
{
int x,y;
Console c=System.console();
x=Integer.parseInt(c.readLine("輸入x的值:"));
y=Integer.parseInt(c.readLine("輸入y的值:"));
System.out.println("x+y="+(x+y));
System.out.println("x-y="+(x-y));
System.out.println("x*y="+(x*y));
System.out.println("x/y="+(x/y));
System.out.println("x%y="+(x%y));
}
}
複製代碼
作者:
楊澤全
時間:
2021-1-22 09:38
import java.io.Console;
public class Ch01
{
public static void main(String args[])
{
int a,b;
Console c=System.console();
a=Integer.parseInt(c.readLine("請輸入a的值:"));
b=Integer.parseInt(c.readLine("請輸入b的值:"));
System.out.println("a+b="+(a+b));
System.out.println("a-b="+(a-b));
System.out.println("a*b="+(a*b));
System.out.println("a/b="+(a/b));
System.out.println("a%b="+(a%b));
}
複製代碼
作者:
卓炘暘
時間:
2021-1-22 09:38
本帖最後由 卓炘暘 於 2021-1-22 09:39 編輯
import java.io.Console;
public class Ch03
{
public static void main(String args[])
{
int x,y;
Console c=System.console();
x=Intergar.aseInt(c.readLine("請輸入x的值: "));
y=Intergar.aseInt(c.readLine("請輸入y的值: "));
System.out.println("x+y="+(x+y));
System.out.println("x-y="+(x-y));
System.out.println("x*y="+(x*y));
System.out.println("x/y="+(x/y));
System.out.println("x%y="+(x%y));
}
}
複製代碼
作者:
楊澤全
時間:
2021-1-22 09:54
import java.io.Console;
public class Ch02
{
public static void main(String args[])
{
float a,b;
Console c=System.console();
a=Float.parseFloat(c.readLine("請輸入三角形的底(公分):"));
b=Float.parseFloat(c.readLine("請輸入三角形的高(公分):"));
System.out.print("底"+a+"公分,");
System.out.print("高"+b+"公分的三角形,");
System.out.print("面積為"+(a*b/2)+"平方公分");
}
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2