作业帮 > 英语 > 作业

英语翻译The programming language Ada has integer constants that

来源:学生作业帮 编辑:百度作业网作业帮 分类:英语作业 时间:2024/06/06 02:13:50
英语翻译
The programming language Ada has integer constants that look like this:123,8#123#,16#abc#.These constants represent the integers 123,83 (123 base 8) and 2739 (abc base 16).More precisely,an integer may be a decimal integer given as a sequence of one or more digits less than 10,or it may be an integer to some specific base,given as the base followed by a sequence of one or more digits less than the base enclosed by # symbols.Lower case letters from a through f are used as the digits representing 10 through 15.In Ada,the base,if specified,must be a sequence of decimal digits.For this problem,however,the base may be of any form described above so long as it represents an integer between 2 and 16 inclusive.
Input
The first line of input contains a positive integer n.n lines follow.
Output
For each line of input,output a line "yes" if it is a valid integer constant according to the above rules; otherwise output a line containing "no".Input lines contain no spaces and are between 1 and 80 characters in length.
Sample Input
5
2#101#
2#101##123#
17#abc#
16#123456789abcdef#
16#123456789abcdef#123456789abcdef#
Sample Output
yes
yes
no
yes
no
英语翻译The programming language Ada has integer constants that
ada(一种编程语言)有两种整形常量如下:123,8#123#,16#abc#.这些常量表示整数123,83(八进制123),2739(16进制abc).严格的说:一个整形可以使一系列小于10的数字表示的十进制数,或是一个由符号#表示的x进制数.小写字母a到f表示十进制的10到15.进制数x的范围是2到16.
输入
第一行输入一个正数n.后面几行输入n行.
输出
对于每行输出,'yes'表示 此数按照以上规则合法.反之,'no'表示非法
输入数字在1到80字符之间.
输入例子
xxx
输出例子
xxxxx