import java.io.*; /** * 注意不能前面用 cin.nextToken() 后面用 in.readline(),用 in.readline() 必须从头用到尾,否则会阻塞输入。 * Java 中的类实际就是 C++ 里的结构体。 * 通过重写 toString 可以方便输出对象。 */ public class Main { public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); public static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out)); public static StreamTokenizer cin = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); public static PrintWriter cout = new PrintWriter(new OutputStreamWriter(System.out)); public static void main(String[] args) throws Exception { class student { String[] s; public student() { s = new String[5]; } @Override public String toString() { return s[0] + ',' + s[1] + ',' + s[2] + ',' + s[3] + ',' + s[4]; } } int n = Integer.parseInt(in.readLine()); student[] a = new student[n]; for (int i = 0; i < n; i++) { a[i] = new student(); } for (int i = 0; i < n; i++) { String s = in.readLine(); a[i].s = s.split(" "); } for (student i : a) { cout.println(i); } cout.flush(); } }
0.0分
0 人评分
数字整除 (C++代码)——(22行代码)真的只需要两个变量就够了浏览:1867 |
C语言程序设计教程(第三版)课后习题6.8 (C语言代码)浏览:724 |
点我有惊喜!你懂得!浏览:1008 |
C语言程序设计教程(第三版)课后习题6.7 (C语言代码)浏览:778 |
C语言程序设计教程(第三版)课后习题9.4 (C语言代码)浏览:760 |
P1002 (C语言代码)浏览:1019 |
C语言训练-计算1977!* (C++代码)浏览:907 |
C语言程序设计教程(第三版)课后习题8.9 (Java代码)浏览:1413 |
C语言程序设计教程(第三版)课后习题7.3 (C语言代码)浏览:1215 |
WU-复数求和 (C++代码)浏览:2120 |