跳到正文

个人记录

(做了一个几乎全平台适用的快读快输)

SilverChariot_R约 2 分钟
原文
文章信息与版本

文章信息

发布
2026年11月27日
收录
2026年11月27日
更新
2026年11月27日
篇幅
约 2 分钟

版本

  1. v1当前
C++
#include <cstdio>

#ifdef _WIN32 
	#ifdef _WIN64 
		#define getchar_ _getchar_nolock
		#define putchar_ _putchar_nolock
	#else 
		#define getchar_ _getchar_nolock
		#define putchar_ _putchar_nolock
	#endif
#elif defined(__linux__) 
		#define getchar_ getchar_unlocked
		#define putchar_ putchar_unlocked
#endif 

int read () {
	int s = 0, f = 1;
	char ch = getchar_ ();
	while (ch > '9' || ch < '0') {
		if (ch == '-') f = -f;
		ch = getchar_ ();
	}
	while (ch >= '0' && ch <= '9') {
		s = (s << 3) + (s << 1) + (ch ^ 48);
		ch = getchar_ ();
	}
	return s * f;
}
void write (int num) {
	if (num == 0) {
		putchar_ ('0');
		return;
	}
	if (num < 0) {
		putchar_ ('-');
		num = -num;
	}
	char st[10] = {};
	char *top = st;
	while (num != 0) {
		*(++ top) = num % 10 | 48;
		num = num / 10;
	}
	while (top != st) {
		putchar_ (*top --);
	}
	return;
}

signed main () {
    // TODO 
    return 0;
}
原文