永发信息网

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

答案:1  悬赏:20  手机版
解决时间 2021-01-03 13:19
英语翻译
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
最佳答案

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


我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
为什么我注册淘宝帐号时出现该手机号码己注册
珠宝陈列道具设计方案需要给设计费吗?
两个完全相同的容器中,分别盛有甲、乙两种液
期货中的顶点柜台指的是什么?
下列广告语中你认为正确的是A.“超纯水”绝对
已前这个组词对还是错
一个无盖的圆柱体水桶可以装水多少升?就是求
买手机官方标配是什么意思?
我想学金融,学文还是学理?
我想报考成考,有限制吗?只有技师学校发的“
施工员都干什么
某一瞬间的感受和体验100字
已知集合M={x|x2-4x+4a<0}且2?M,则实数a的
如果y=(m-2)是关于x的二次函数,则m=______
开网店需要具备哪些条件?
推荐资讯
调皮的反义词词
有卡贴的苹果手机现在没有信号怎么回事
半江村委会地址在什么地方?想过去办事
武联村委会位置在什么地方啊,我要过去办理业
神说,我们要照着我们的形象,按着我们的样式
我国是一个历史悠久、人口众多、生产力相对落
春草村委会办公地址在什么地方?我要处理点事
今日头条,头条号审核要多久
喝多了和喝醉了是一个意思吗?有什么不同
It’s difficult to the discussion with all
假设有一辆超级电容车,质量m=2*10^3kg,额定功
The book is said to the special one,many e
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?