作業1
阿新 • • 發佈:2017-09-11
time ces index word avg num size welcome mil
1.2
public class welcome
{
public static void main(String[] args){
System.out.println("Welcome to java!");
System.out.println("Welcome to java!");
System.out.println("Welcome to java!");
System.out.println("Welcome to java!");
System.out.println("Welcome to java!");}
}
1.8
public
class
Main {
public
static
void
main(String args[]) {
Scanner sc =
new
Scanner(System.in);
System.out.print(
"半徑為5.5"
);
int
r = sc.nextInt();
sc.close();
double
s = Math.PI * 5.5 * r;
double
c = Math.PI * 5.5 *
2
;
System.out.println(
"圓的面積:"
+ s +
",圓的周長:"
+ c);
}
}
1.12
public double getAvg(double time,double len){
double hour = time/60;
double _len = len/1.6;
double avg = _len/hour;
return avg;
}
作業1