<分区>
我的 friend 说可以编写一个 C 程序来打印“hello world”,而无需 IF/WHILE/FOR
和分号。经过最少的研究后,我告诉她这是不可能的。可能吗?
<分区>
我的 friend 说可以编写一个 C 程序来打印“hello world”,而无需 IF/WHILE/FOR
和分号。经过最少的研究后,我告诉她这是不可能的。可能吗?
最佳答案
#include <stdio.h>
int main() {
switch (printf("Hello, world!\n")) {}
}
如果您的 friend 说“哦,您也不能使用 switch”,那么:
#include <stdio.h>
int main(int argc, char *argv[printf("Hello, world!\n")]) {}
关于c - C 中的 hello world 没有分号且没有 IF/WHILE/FOR 语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4147836/