62,616
社区成员
发帖
与我相关
我的任务
分享
public class InputTest {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String accept = scanner.nextLine();
String[] str = accept.split(",");
int[] a = new int[str.length];
int max = Integer.parseInt(str[0]);
for(int i=0; i<a.length; i++) {
a[i] = Integer.parseInt(str[i]);
if(max < a[i]) {
max = a[i];
}
}
for(int i=0; i<a.length;i++) {
System.out.print(a[i] + "\t\t");
}
System.out.println();
System.out.println(max);
}
}
import java.io.IOException;
class ByteTest{
public static void main(String args[]) throws IOException {
int i, n, sum=1;
System.out.println("Please input(0~7):");
n = System.in.read();
System.out.println("输入时的n:"+n);
n -= 48; //这到底是什么意思??为什么一定非要是48呢?
System.out.println("减48后的n:"+n);
for (i = 1; i <= n; i++)
sum *= i;
System.out.println(n + "!= " + sum);
}
}
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
reader.readLine();