From 000e34da4618652844f5805baa6e7096f3196a9f Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Sun, 31 Aug 2025 11:12:40 +0800 Subject: [PATCH] =?UTF-8?q?refactor(test.cpp):=20=E6=9B=BF=E6=8D=A2cstdio?= =?UTF-8?q?=E4=B8=BAiostream=E5=B9=B6=E7=AE=80=E5=8C=96=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将测试文件中的cstdio替换为iostream,并移除不必要的指针操作。 简化测试逻辑,直接测试位移操作并输出结果。 --- src/8/31/P2704.cpp | 0 src/test.cpp | 14 ++++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 src/8/31/P2704.cpp diff --git a/src/8/31/P2704.cpp b/src/8/31/P2704.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/test.cpp b/src/test.cpp index fc003d2..6f8d19d 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -1,10 +1,8 @@ -#include +#include +using namespace std; + int main(){ - int a=0; - char* c = (char*)&a; - c[0]=0x1f; - c[1]=0x1f; - c[2]=0x1f; - c[3]=0x1f; - printf("%d\n",a); + int a = 1; + a<<=32; + cout<