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

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]+" "); } }}

完整的代码如下: public class Demo01 {public static void main(String[] args) {Scanner sc = new Scanner(System.in);int[] a = new int[10];int i = 0;// 输入10个整数while (true) {a[i] = sc.nextInt();i++;if (i == 10) {break;}}// 冒...

#include "stdio.h" void main() { int a[10]; int i,j,k; printf("请输入十个数字:\n"); for(i=0;i

#include int main(){ int a[10], *p, *m, t; for(p = a; p

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = 10; int[] b = new int[a]; int i=0; int c = 0; while(ib[i])?b[i]:c; }else{ c=b[i]; } i++; } for(...

#include "stdio.h" #define N 20 int main() { int a[10],i,j=0,n=0,c=0; for(i=0;i

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