# 問題 B: C語言-成績排序

### 問題 B: C語言-成績排序

[提交] [狀態] [命題人:外部導入]

```2
a100 zhblue 70 80 90
b200 newsclan 90 85 75
```

```a100,zhblue,70,80,90
b200,newsclan,90,85,75```

import java.util.Scanner;

public class Main {

public static void main(String[] args) {
// TODO 自動生成的方法存根
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
String temp = scan.nextLine();
//StringBuffer out = new StringBuffer();
for(int i=0;i<n;i++) {
String rec = scan.nextLine();
rec.trim();
String out = rec.replace(' ', ',');
System.out.println(out);
}
}

}

import java.util.Scanner;

public class Main {

public static void main(String[] args) {
// TODO 自動生成的方法存根
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
String temp = scan.nextLine();
//StringBuffer out = new StringBuffer();
String[] rec = new String[101];
for(int i=0;i<n;i++) {
String trf = scan.nextLine();
rec=trf.split(" ");
for(int j = 0;j<rec.length-1;j++) {
System.out.print(rec[j]+",");
}
System.out.println(rec[rec.length-1]);
}
}

}

import java.util.Arrays;
import java.util.Scanner;

public class Main {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
String[] acc = new String[101];
//int cou = 0;
String c=scan.nextLine();
for(int i=0;i<n;i++){
acc[i]=scan.nextLine();
//System.out.println(acc[i]+" "+i);
//scan.next();
}
for(int j=0;j<n;j++){
for(int k=0;k<acc[j].length();k++){
if(acc[j].charAt(k)==' '){
//acc[j].replace(' ', ' ');
System.out.printf("%c", ',');
}else{
System.out.printf("%c", acc[j].charAt(k));
}
}
System.out.println();
}
}

}