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 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 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...

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.*;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...

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...

import java.util.*;public class demo {public static void main(String[] args) {Scanner sc = new Scanner(System.in);String line = sc.nextLine();System.out.println(new StringBuilder(line).reverse().toString());}}

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