tnfh.net
当前位置:首页 >> JAVA问题:输入10个整数,逆序输出他们? >>

JAVA问题:输入10个整数,逆序输出他们?

import java.util.Scanner; public class test1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a[] = new int [10]; for(int i=0;i=0;j-- ){ System.out.print(a[j]+" "); } } } 这个应该是你要的吧

import java.util.Scanner;public class Demo001 {public static void main(String[] args) {System.out.println("请输入10个数,以空格隔开:");Scanner scaner = new Scanner(System.in);String strInput = scaner.nextLine();String a[] = st...

import java.util.Scanner;public class Array {public static void main(String[] args) {Scanner scanner = new Scanner(System.in);int [] a = new int[10];int count = 0;System.out.println("请输入10个整数");while (true) {if(scanner.ha...

参考代码: import java.util.*;public class Demo { public static void main(String[] args) { double[] nums = new double[10]; Scanner input = new Scanner(System.in); for (int i = 0; i < 10; i++) { nums[i] = input.nextDouble(); } f...

public static void main(String []args){ Scanner in=new Scanner(System.in); int n=in.nextInt(); while(n!=0){ System.out.print(n%10); n/=10; }}

import java.util.Scanner;public class test1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a[] = new int [10]; for(int i=0;i=0;j-- ){ System.out.print(a[j]+" "); } }}

//不要全部粘贴复制,这个你应该明白,包名和类名都不一样的package 作业;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class Demo { public static void main(String[] args) { // TODO...

public class Demo1 { public static void main(String[] args) { int a = 987; int bai = a / 100; int shi = a / 10 % 10; int ge = a % 100 % 10; System.out.println("" + ge + shi + bai); } } 或者 public class Demo1 { public static vo...

java.util.Scanner scanner = new java.util.Scanner(System.in); int len = 10; int[] result = new int[len]; for(int i=0;i=0;i--){ System.out.println(result[i]); } 放到主函数里就可以了 采纳哦

网站首页 | 网站地图
All rights reserved Powered by www.tnfh.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com