標題:
高中生程式解題系統
[打印本頁]
作者:
ray
時間:
2019-11-16 15:39
標題:
高中生程式解題系統
https://zerojudge.tw/
作者:
李知易
時間:
2019-12-14 19:51
import java.io.*;
import java.util.*;
public class B964 {
B964()
{
StreamTokenizer cin = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
try{
while(cin.nextToken()!=StreamTokenizer.TT_EOF)
{
int n = (int)cin.nval;
int[] s = new int[n];
for(int i = 0; i<s.length; i++)
{
cin.nextToken();
s[i] = (int)cin.nval;
}
Arrays.sort(s);
for(int i=0;i<s.length;i++)
{
if(i!=0)
{
out.print(" ");
out.flush();
}
out.print(s[i]);
out.flush();
}
if()
out.println();
out.flush();
}
}catch(Exception e){}
}
public static void main(String[] args) {
// TODO 自動產生的方法 Stub
new B964();
}
}
複製代碼
作者:
李知易
時間:
2019-12-21 20:14
B965:
import java.io.*;
import java.util.*;
public class B965 {
B965()
{
StreamTokenizer cin = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
try{
while(cin.nextToken()!=StreamTokenizer.TT_EOF)
{
int r = (int)cin.nval;
cin.nextToken();
int c = (int)cin.nval;
cin.nextToken();
int m = (int)cin.nval;
int[] mn = new int[m];
int[][] b = new int[r][c];
//r , c 行列數
for(int i = 0; i < r; i++)
{
for(int j = 0; j < c; j++)
{
cin.nextToken();
b[i][j] = (int)cin.nval;
if(j != 0)
out.print(" ");
out.print(b[i][j]);
}out.println();
}
for(int i = 0; i<mn.length; i++)
{
cin.nextToken();
mn[i] = (int)cin.nval;
}
out.println();
out.flush();
}
}catch(Exception e){}
}
public static void main(String[] args) {
// TODO 自動產生的方法 Stub
new B965();
}
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2