import java.io.UnsupportedEncodingException;
import java.util.Scanner;
public class ZiFuChuanHe {
public static void main(String[] args) throws UnsupportedEncodingException {
Scanner s=new Scanner(System.in);
System.out.println("请输入第一个字符");
String t=s.next();
byte []bytes =t.getBytes();
int U= bytes[0];
System.out.println("请输入第二个字符");
String t1=s.next();
byte []bytes1 =t1.getBytes();
int U1= bytes1[0];
System.out.println(bytes[0]);
System.out.println(bytes1[0]);
System.out.println(U+U1);
}
}
实现从命令行参数输入两个字符串类型的数值,并计算输出两个数值的和。 [必做题]
最新推荐文章于 2023-06-10 03:20:48 发布