题目1066:字符串排序
题目1067:n的阶乘
题目1068:球的半径和体积
import java.io.IOException;
import java.io.StreamCorruptedException;
import java.util.*;
public class Main {
public static void main(String arg[]) throws IOException{
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
//1066 字符串排序
/*String s = sc.nextLine();
char[] x = s.toCharArray();
Arrays.sort(x);
s="";
for(int i:x) s+=(char)i; //原本使用的是for(int i:x) System.out.print(i);极其耗费时间,AC不了。
System.out.println(s);*/
//1067 n的阶乘
/*int n = sc.nextInt();
if(n==0) System.out.println(1);
else {
long total=1; //int 越界了,使用long
for(int i=1;i<n+1;i++)
total *=i;
System.out.println(total);
} */
//题目1068:球的半径和体积
double x1=sc.nextDouble();
double y1=sc.nextDouble();
double z1=sc.nextDouble();
double x2=sc.nextDouble();
double y2=sc.nextDouble();
double z2=sc.nextDouble();
double pi = Math.acos(-1);
//System.out.println(pi);
double r = Math.sqrt(Math.pow(x2-x1, 2)+Math.pow(y2-y1, 2)+Math.pow(z2-z1, 2));
double V =pi*Math.pow(r, 3)*4/3.0;
System.out.format("%.3f %.3f\n", r,V);
}
}
}