我擦,C++列印0-999,只要三行,這麼簡單???
阿新 • • 發佈:2021-07-17
\(4.2\) 竟然更新了:
`
先發code,防金針菇
#include <bits/stdc++.h>
#define A(x) x;x;x;x;x;x;x;x;x;x;
long long main() {int n = 0; A(A(A(printf("%d ",n++))));}
WHY
先付原陽間程式碼
Shift+Ctrl+a ing~~~~~~~~~~~~~~~~~
#include <bits/stdc++.h>//標頭檔案好評(tao) using namespace std;//名字空間好評(tao*2) #define A(x) x;x;x;x;x;x;x;x;x;x; //NOIP中的define題就是平時授……呃呃呃,跑題了(tao*3) int main() { long long n = 0; A(A(A(printf("%d ",n++)))); /*相當於把printf命令複製貼上1000次, 然後按照從左往右執行, 每次n都執行了一次n++操作 其實就是等於printf("%d ",n++); printf("%d ",n++); printf("%d ",n++); printf("%d ",n++); printf("%d ",n++);.....*/ return 0;//return 0;好評(tao*4) /*其實還可以通過增加printf前的括號和大寫A來改變列印的數量, 比如0-99;0-999;0-9999; 0-9999999999999999999999……………………………………………… (差點忘了,要在整型範圍內(tao*5))*/ }
這道題其實是在
https://blog.csdn.net/qq_40969467/article/details/105431440
看到的