1. 输入三个數A B C , 从大到小排列
2. 一个球 从10米高落到地下 反弹1/2高 又落下 又反弹1/2高 请问 十次以后 球高度是多少
3. 还是1!+2!+3!+....+20!
4. 输出 9*9 口诀
5 算出2/1 + 3/2 + 5/3 + 8/5 + 13/8 ++ 的和
2. 一个球 从10米高落到地下 反弹1/2高 又落下 又反弹1/2高 请问 十次以后 球高度是多少
3. 还是1!+2!+3!+....+20!
4. 输出 9*9 口诀
5 算出2/1 + 3/2 + 5/3 + 8/5 + 13/8 ++ 的和
解决方案 »
- this关键字
- 请教一个网页生成图片的问题
- socket 读取的 socket.in.read(byte b[], int off, int len)的byte 里 00 输出之后怎么成了 一个0了
- drawArc和fillArc有什么区别
- 已经一天多了,再解决不了,我就要疯了!jdbc!!
- Java入门问题 2
- 急急!!在linux 下如何安装 jdk1.4.2 打什么命令阿
- Socket程序两台电脑为什么连接失败?(在同一台电脑上就成功)
- 用java如何实现贴吧签到
- 为什么我在Applet程序中,执行会没反应?
- LinuxAS4下安装oracle9i报"java/lang/NoClassDefFoundError: java/lang/Object"错,请高手指点
- 关于try,catch有一点不明
1)
public class Taxis { /**
* @param args
*/
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
double a=in.nextDouble();
double b=in.nextDouble();
double c=in.nextDouble();
double t;
if(a<b)
{t=a;a=b;b=t;}
if(a<c)
{t=a;a=c;c=t;}
if(b<c)
{t=b;b=c;c=t;}
System.out.println(a+">"+b+">"+c);
}}
public class Height { /**
* @param args
*/
public static void main(String[] args) {
double height=10;
int time=10;
double newHeight=height*Math.pow(0.5, time);
System.out.println("After 10 times ,the newHeight:"+newHeight);
}
}
public class Factorial_Sum { /**
* @param args
*/
public static void main(String[] args) {
long sum=0;
for(int i=1;i<=20;i++){
sum+=factorial(i);
}
System.out.println(sum);
} public static long factorial(int n){
long sum=1;
for(int i=1;i<=n;i++){
sum*=i;
}
return sum;
}
}
class SortThreeNumbers{
public static void main(String[] args){
if(args.length==0){
System.out.println("useage: java SortThreeNumbers xx xx xx");
System.exit(0);
}
int[] a=new int[args.length];
for(int i=0;i<args.length;i++){
a[i]=Integer.parseInt(args[i]);
}
Arrays.sort(a);
for(int i=0;i<a.length;i++){
System.out.println(a[i]);
}
}
}
{
//输入 a b c ,从大到小排列
public static void sort()
{
try
{
int a,b,c,temp;
System.out.println("请输入数");
a = System.in.read();
b = System.in.read();
c = System.in.read();
if(a<b)
{
temp = a;
a = b;
b = temp;
}
if(a<c)
{
temp = a;
a = c;
c = temp;
}
if(b<c)
{
temp = b;
b = c;
c = temp;
}
System.out.println((a-48) +","+(b-48)+","+(c-48) );
}
catch(Exception e){}
}
//输出9*9
public static void prt()
{
for(int i=1;i<10;i++)
{
for(int j=i;j<10;j++)
{
System.out.print(i+"*"+j+"="+i*j+" ");
}
System.out.println();
}
}
public static void main(String [] args)
{
//sort();
prt();
}
}