个人作业 2017.10.20
来源:互联网 发布:js document 创建标签 编辑:程序博客网 时间:2024/05/18 15:07
一.编写一个应用程序,给出汉字“你” “我“ “他”三个汉字在Unicode表中的位置
以下为代码
package test;//顶端这句里的test为项目名字public class Unicode_number {public static void main(String args[]){char A='你',B='我',C='他';System.out.println("汉字\'你'在unicode表中的位置:"+(int)A);System.out.println("汉字\'我'在unicode表中的位置:"+(int)B);System.out.println("汉字\'他'在unicode表中的位置:"+(int)C);} }
效果图(编译器为eclipse,四分栏模式,第三栏为输出效果)
Unicode和汉字之间的转化原理还在学习中..........
二.编写一个应用程序,输出全部的希腊字母
package test;public class PrintGreekLetter{public static void main(String args[]){ int firstLetter, lastLetter; char firstG = 'α'; char lastG = 'ω'; /*这里要获取字母表首尾字母*/ firstLetter = (int)firstG; /*这里两句表面为其做类型转换,实际上可以转化其为机器编码,这里和C语言类似*/ lastLetter = (int)lastG; System.out.println("希腊字母表: "); for(int i = firstLetter; i <= lastLetter; ++i) /*由于字母在机器编码上存在大小关系,且大小连续,可用循环语句遍历*/ { char xilaLetter; xilaLetter = (char)i; System.out.print(" "+xilaLetter); } System.out.println(); } }效果图(编译器为eclipse,二分栏模式,第二栏为输出效果)
阅读全文
0 0
- 个人作业 2017.10.20
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- 个人作业
- shadow 端口被占用解决方法
- 返回两个求和等于给定值的数组下标--算法练习
- 类抢红包方案
- c语言与c++中const的区别
- 南阳理工_66分数拆分
- 个人作业 2017.10.20
- np.array 添加维度
- 多条目加载
- HTML route 登录+游戏+修改密码
- 使用过滤器对所有请求进行字符编码过滤
- Python numpy.random中的shuffle和permutation函数的区别
- Lavarel 5.5安装步骤整理
- exce函数族及其用法
- ipython notebook使用教程