自己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 +" 元");
}
}
}
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("此球員為萬年板凳球員!");
}
}
}
文章定位: