Java

public class E{
public static void main(String args[]) {
char ch = '研', zifu = 0;
int p = 22920, count = 5, position = 0;
System.out.printf("输出%d 个石字傍的汉字:\n", count);
for (char c = ch; c <= ch + count; c++) {
//【代码1】char转int赋值给position
position = (int) c;
System.out.printf("%c(%d)", c, position);
}
System.out.printf("\n 输出%d 个女字傍的汉字:\n", count);
for (int n = p; n <= p + count; n++) {
//【代码2】int转char赋值给zifu
zifu = (char) n;
System.out.printf("%c(%d)", zifu, n);
}
}
}

posted @ 2026-06-11 13:27  ww权  阅读(2)  评论(0)    收藏  举报