统计信息

  • 访问数:9586
  • 博客数:142
  • 建立时间:2008-01-05
  • 更新时间:2008-05-21
我叫王超然,是一名电脑爱好者,现在在新加坡留学上高一.我立志成为一名电脑人才,愿意在这里与大家一同分享我玩转电脑的心得.O-level华文考了A-One哈哈!

P6Q03

2008-04-14 15:58:28

天气: 晴朗 心情: 高兴

/*Filename:P6Q03
 * Name:Wang Chaoran
Description:3 (Reversing the numbers entered)
Write a program that reads ten integers and displays them in the reverse of the order in which they were read.
*/
import java.util.Scanner;
class P6Q03{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    double[] input = new double[10];
    for(int i=0;i<input.length;i++){
    System.out.println("Please input number "+(i+1)+": ");
    input[i]=scan.nextDouble();
    }
    System.out.println("Reverse order: ");
    for(int i=input.length-1;i>=0;i--)
      System.out.print(input[i]+" ");   
  }
}
加入收藏 编辑 审核

TAG: computing

我来说两句

OPEN

Powered by X-Space 1.2 © 2001-2006 Comsenz Technology Ltd