我写过的最蠢的代码

1. 萌新啥也不会

#indluce《iosdream》
unsigned namesbace stb;
itn mian<>"
	itn a,b'
	cni<<a<<b'
	cotu>>a+b'
	rteurn 0 '
"
一个功(biān)能(yì)齐(cuò)全(wù)的A+B Problem

3. 为什么?

#include<iostream>
using namespace std;
int main(){
	int a,b;
	cin<<a<<b;
	cout>>a+b;
	return 0;
}

[Error] no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')

2. 会一点,但不多

#include<iostream>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    cout<<a+b;
    return 0;
}

 4. 黄金时代

5. 黄金时代2

6. 关闭不了哦~~~~~~

#include<iostream>
#include<windows.h>
using namespace std;
void can_not_close(){
	HWND hwnd=GetConsoleWindow();
	HMENU hmenu=GetSystemMenu(hwnd,false);
	RemoveMenu(hmenu,SC_CLOSE,MF_BYCOMMAND);
	LONG style=GetWindowLong(hwnd, GWL_STYLE);
	style&=~(WS_MINIMIZEBOX);
	SetWindowLong(hwnd,GWL_STYLE,style);
	SetWindowPos(hwnd,HWND_TOP,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
	ShowWindow(hwnd,SW_SHOWNORMAL);
	DestroyMenu(hmenu);
	ReleaseDC(hwnd,NULL);
}
int main(){
	can_not_close();
}

7. 买Hello,World!还dfs

#include<iostream>
using namespace std;
int tree[16]={0,'H','e','r','l',',','l','!','l','o','W','o','d',0,0,0};
char ch;
void dfs(int n){
	if(tree[n]!=0){
		ch=tree[n];
		cout<<ch;
	}
    if((n==15)||(n*2>15)||(n*2+1>15)){
        return;
    }
	dfs(n*2);
	dfs(n*2+1);
}
int main(){
	dfs(1);
}

8. 论#define的重要性

#include<iostream>
#define a using
#define b namespace
#define c std
a b c;
#define d int
#define e main
#define h cin
#define i cout
#define q +
d e(){
	d f,g;
	h>>f>>g;
	i<<f q g;
	#define r return
	r 0;
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值