Java题解
成绩输入输出
http://www.nowcoder.com/questionTerminal/eb49750ef0de47168c21761de086d97c
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scanner =new Scanner(System.in);
String str =scanner.nextLine();
String[] numstr =str.split(" ");
int[] nums =new int[numstr.length];
for(int i=0;i<numstr.length;i++) {
nums[i]=Integer.parseInt(numstr[i]);
}
for(int j=0;j<numstr.length;j++) {
if(j<numstr.length-1)
System.out.print("score"+(j+1)+"="+nums[j]+",");
else
System.out.print("score"+(j+1)+"="+nums[j]);
}
}
}