123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import org.aspectj.testing.Tester;
- public class OctalChars {
- public static void main(String[] args) {
- new OctalChars().realMain(args);
- }
- public void realMain(String[] args) {
- char[][] chars = {
- {'\0','\00','\000',},{'\1','\01','\001',},{'\2','\02','\002',},{'\3','\03','\003',},
- {'\4','\04','\004',},{'\5','\05','\005',},{'\6','\06','\006',},{'\7','\07','\007',},
- {'\10','\010',},{'\11','\011',},{'\12','\012',},{'\13','\013',},
- {'\14','\014',},{'\15','\015',},{'\16','\016',},{'\17','\017',},
- {'\20','\020',},{'\21','\021',},{'\22','\022',},{'\23','\023',},
- {'\24','\024',},{'\25','\025',},{'\26','\026',},{'\27','\027',},
- {'\30','\030',},{'\31','\031',},{'\32','\032',},{'\33','\033',},
- {'\34','\034',},{'\35','\035',},{'\36','\036',},{'\37','\037',},
- {'\40','\040',},{'\41','\041',},{'\42','\042',},{'\43','\043',},
- {'\44','\044',},{'\45','\045',},{'\46','\046',},{'\47','\047',},
- {'\50','\050',},{'\51','\051',},{'\52','\052',},{'\53','\053',},
- {'\54','\054',},{'\55','\055',},{'\56','\056',},{'\57','\057',},
- {'\60','\060',},{'\61','\061',},{'\62','\062',},{'\63','\063',},
- {'\64','\064',},{'\65','\065',},{'\66','\066',},{'\67','\067',},
- {'\70','\070',},{'\71','\071',},{'\72','\072',},{'\73','\073',},
- {'\74','\074',},{'\75','\075',},{'\76','\076',},{'\77','\077',},
- };
-
- for (int i = 0; i < chars.length; i++) {
- char[] cs = chars[i];
- for (int j = 0; j < cs.length; j++) {
- Tester.check((int)cs[j]==i, i + "!='\\"+Integer.toOctalString(i)+"'");
- }
- }
-
- // for (int i = 0; i < 8; i++) {
- // String s = Integer.toOctalString(i)+"";
- // System.out.print("{");
- // for (int j = 0; j < 3; j++, s = "0" + s) {
- // System.out.print("'\\"+s+"',");
- // }
- // System.out.println("},");
- // }
- // for (int i = 010; i < 0100; i++) {
- // String s = Integer.toOctalString(i)+"";
- // System.out.print("{");
- // for (int j = 0; j < 2; j++, s = "0" + s) {
- // System.out.print("'\\"+s+"',");
- // }
- // System.out.println("},");
- // }
- }
-
- }
|