编程介的小学生 2017-04-08 11:22 采纳率: 20.5%
浏览 787
已采纳

?(>_o)!

?(>_o)! is a pseudo-object-oriented programming language. It implements the following commands:

Command Description
? Check whether the character '?' is in the program's source code. If '?' does not exist in the program's source, the hardware will catch fire or explode.
( It tries to match ')', although mismatch of brackets does not matter at all.

Increase the internal accumulator.
_ Print the program's source code.
o Instantiate an object of a new sub class of the generic super class. Due to the best principles of object hiding, this object cannot be accessed in any way.
) Just matches '('. It's for patient with obsessive-compulsive disorder. However, mismatch of brackets does not matter at all.
! Print "Hello, world!".
Other characters Be treated as comments rather than instruction.
However, it's only another joke programming language. There is even no way to access the accumulator. But it's one of easiest to finish a "Hello world" program or a quine program. A quine is a computer program which takes no input and produces a copy of its own source code as its only output. Your task is to judge whether a ?(>_o)! program is a quine.

Input

There are multiple test cases. The first line of input is an integer T indicates the number of test cases. For each test case:

There is one line of string represents the source code of a ?(>_o)! program. The program contains no more than 256 characters. The ASCII value of each character is within [32, 126].

Output

For each test case, output "Yes" if it is a quine. Otherwise, output "No".

Sample Input

4
Hello, world!
source_code
source__code
?(>_o)!
Sample Output

Yes
Yes
No
No

  • 写回答

1条回答 默认 最新

  • devmiao 2017-04-08 15:08
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 对于这个复杂问题的解释说明
  • ¥50 三种调度算法报错 采用的你的方案
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败