2007-11-09 01:10:23T.H.
Java 通話費&球員分級
自己RUN吧...
1.
import java.io.*;
public class s96101153
{
public static void main(String[ ] argv) throws IOException
{
BufferedReader CtTr = new BufferedReader(new
InputStreamReader(System.in));
System.out.print("請輸入撥打分鐘數 : ");
float minute = Float.parseFloat( CtTr.readLine());
if( minute<800 )
{
System.out.println("您的通話費為: "+ minute*0.9 +" 元");
}
else if( 800<=minute & minute<=1500 )
{
System.out.println("您的通話費為: "+minute*0.81 +" 元");
}
else if( minute>1500 )
{
System.out.println("您的通話費為: "+minute*0.72 +" 元");
}
}
}
1.
import java.io.*;
public class s96101153
{
public static void main(String[ ] argv) throws IOException
{
BufferedReader CtTr = new BufferedReader(new
InputStreamReader(System.in));
System.out.print("請輸入撥打分鐘數 : ");
float minute = Float.parseFloat( CtTr.readLine());
if( minute<800 )
{
System.out.println("您的通話費為: "+ minute*0.9 +" 元");
}
else if( 800<=minute & minute<=1500 )
{
System.out.println("您的通話費為: "+minute*0.81 +" 元");
}
else if( minute>1500 )
{
System.out.println("您的通話費為: "+minute*0.72 +" 元");
}
}
}
2.
import java.io.*;
public class s96101153
{
public static void main(String[ ] argv) throws IOException
{
BufferedReader CtTr = new BufferedReader(new
InputStreamReader(System.in));
System.out.print("請輸入得分數 : ");
float grade = Float.parseFloat( CtTr.readLine());
System.out.print("請輸入籃板球數 : ");
float rebound = Float.parseFloat( CtTr.readLine());
System.out.print("請輸入助攻次數 : ");
float help = Float.parseFloat( CtTr.readLine());
System.out.print("請輸入抄截次數 : ");
float take = Float.parseFloat( CtTr.readLine());
System.out.print("請輸入失誤次數 : ");
float mistake = Float.parseFloat( CtTr.readLine());
Float bker = (grade*1+rebound*2+help*2+take*2 - mistake*2);
if( bker>=45 )
{
System.out.print("此球員為A級球員!");
}
else if( 25<=bker & bker<=44 )
{
System.out.print("此球員為B級球員!");
}
else if( 10<=bker & bker<=24 )
{
System.out.print("此球員為C級球員!");
}
else if( 9>=bker )
{
System.out.print("此球員為萬年板凳球員!");
}
}
}
import java.io.*;
public class s96101153
{
public static void main(String[ ] argv) throws IOException
{
BufferedReader CtTr = new BufferedReader(new
InputStreamReader(System.in));
System.out.print("請輸入得分數 : ");
float grade = Float.parseFloat( CtTr.readLine());
System.out.print("請輸入籃板球數 : ");
float rebound = Float.parseFloat( CtTr.readLine());
System.out.print("請輸入助攻次數 : ");
float help = Float.parseFloat( CtTr.readLine());
System.out.print("請輸入抄截次數 : ");
float take = Float.parseFloat( CtTr.readLine());
System.out.print("請輸入失誤次數 : ");
float mistake = Float.parseFloat( CtTr.readLine());
Float bker = (grade*1+rebound*2+help*2+take*2 - mistake*2);
if( bker>=45 )
{
System.out.print("此球員為A級球員!");
}
else if( 25<=bker & bker<=44 )
{
System.out.print("此球員為B級球員!");
}
else if( 10<=bker & bker<=24 )
{
System.out.print("此球員為C級球員!");
}
else if( 9>=bker )
{
System.out.print("此球員為萬年板凳球員!");
}
}
}
上一篇:Java 所有稅&密碼輸入
下一篇:狼人壞小孩丟洗哇^^
兒子...你們都在學這種東西喔
也太酷了吧
你還真是學資訊ㄉ料..很適合你..哈
"這種東西"也還好不會很酷啦~
上次還被一個全形的空格搞到快瘋掉= =
(要用半形字...用全形就錯了= =") 2007-11-12 13:14:51