snrg.net
当前位置:首页 >> 用JAvA编写程序,从标准输入(即键盘)读入10个整数存入整型数组A中,然后逆序输出这10个整数 >>

用JAvA编写程序,从标准输入(即键盘)读入10个整数存入整型数组A中,然后逆序输出这10个整数

import java.util.Scanner;public class Test43 { public static void main(String[] args) { System.out.println("请输入10个数字,输入每个数字后以回车结束");// 提示语句,输入一个数要按下回车 Scanner sc = new Scanner(System.in);// 这是一

package test; import java.util.Scanner; public class temp { public static void main(String[] args){ int[] a = new int[10]; int max = 0; int sum = 0; int pos = 0; Scanner s = new Scanner(System.in); for(int i=0;i<a.length;i++){ a[i] = s.nextInt(); } for(int i=0;i<a

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 a[i] = sc.nextint(); } for(int j=a.length-1;j>=0;j-- ){ system.out.print(a[j]+" "); } } }

public class test { /** * @param args */ public static void main(String[] args) { if(args.length<10){ System.out.println("请输入10个数字,并以空格分割"); }else{ for (int i = args.length; i >0; i--) { System.out.println(args[i]); } } } }

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class QuestionOne { /** * 用 JAVA 编程 .. 从键盘输入10个整数存入整型数组中,逆序输出这10个数

#include<stdio.h> main() {int a[10],i; for(i=0;i<10;i++) scanf("%d",&a[i]); for(i=0;i<10;i++) printf("a[i]=%d",a[i]); } 程序2113,5261我检4102测了1653,对内的容

for(int n=0;n

这年头分不好拿啊,你看看我这个是自己写的不? import java.util.Scanner; public class test { public static void main(String[] args) { Scanner s = new Scanner(System.in); int [] a = new int[10]; int min, max; min = max = 0; for(int i = 0; i a[i]) min = i; else if(a[max]

import java.util.*;public class help{public static void main(String []argv){int []a = new int[10];int i, sum = 0;Scanner in = new Scanner(System.in);System.out.print("输入十个数:");for(i = 0; i < 10; i++){a[i] = in.nextInt();System.out.print(a[i] + " ");sum += a[i];}System.out.println("\n和为:" + sum);in.close();}

这年头分不好拿啊,你看看我这个是自己写的不? import java.util.scanner; public class test { public static void main(string[] args) { scanner s = new scanner(system.in); int [] a = new int[10]; int min, max; min = max = 0; for(int i = 0; i a[i]) min = i; else if(a[max]

相关文档
dzrs.net | acpcw.com | tuchengsm.com | whkt.net | dkxk.net | 网站首页 | 网站地图
All rights reserved Powered by www.snrg.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com