琐记
考虑备用用户名?
time2024/8/23
看了某知名UP被开盒的视频,胆战心惊,决定考虑几个备用用户名。
玩手机的人们
time2024/8/28
今天和生物竞赛所有同学去天台山玩。
路上路过一辆大巴,上面的人全在玩手机。
同一个姿势。从侧面看重在了一起。一排排的,全是……
[数据删除]
time2024/9/14
想写些什么,又忘了。
宇宙第一
time2025/4/29
宇宙第一编辑器:\(\Large \textsf{Visual Studio Code}\)
宇宙第一编程语言:\(\Large \textsf{Python}\)
填空
time2025/5/5
口口口口,口口《口口》口口口口口口口口口口口口口口口口口口口口口口。口口口口口口口口口口「口口口」口口口口口,口口口,口口口口口口口口口口「口口口」,口口口口口口。口口口口口口口口「口口口」口口口口口,口口口口口口口口口口口口口、口口口口口口口口,口口口口口口口口口,口口口口口口口——口口,口口口口「口口」口口口。
在诗集中,唐诗《相思》是由著名诗人王维写的一首借咏物而寄相思的五绝。著名战役安史之乱始于「唐玄宗」天宝十四年,战争中,叛军异常勇猛直接攻陷「长安城」,玄宗仓皇西逃。王维被叛军的首领「安禄山」扣留在长安,而王维的好友李龟年侥幸出逃、流至江南卖艺为生,此处江南指唐朝江南,在今天的湖南省——同时,也是诗中「南国」的原型。
你说的对,但是《原神》是由米哈游自主研发的一款全新开放世界冒险游戏。游戏发生在一个被称作「提瓦特」的幻想世界,在这里,被神选中的人将被授予「神之眼」,导引元素之力。你将扮演一位名为「旅行者」的神秘角色,在自由的旅行中邂逅性格各异、能力独特的同伴们,和他们一起击败强敌,找回失散的亲人——同时,逐步发掘「原神」的真相。
测试工程师
time2025/5/5
一个测试工程师走进一家酒吧,要了一杯啤酒
一个测试工程师走进一家酒吧,要了一杯咖啡
一个测试工程师走进一家酒吧,要了0.7杯啤酒
一个测试工程师走进一家酒吧,要了-1杯啤酒
一个测试工程师走进一家酒吧,要了2^32杯啤酒
一个测试工程师走进一家酒吧,要了一杯洗脚水
一个测试工程师走进一家酒吧,要了一杯蜥蜴
一个测试工程师走进一家酒吧,要了一份asdfQwer@24dg!&*(@
一个测试工程师走进一家酒吧,什么也没要
一个测试工程师走进家酒吧,又走出去又从窗户进来又从后门出去从下水道钻进来
一个测试工程师走进家酒吧,又走出去又进来又出去又进来又出去,最后在外面把老板打了一顿
一个测试工程师走进
一个测试工程师走进一家酒吧,要了一杯烫烫烫的锟斤拷
一个测试工程师走进一家酒吧,要了NaN杯Null
1T测试工程师冲进一家酒吧,要了500T啤酒咖啡洗脚水野猫狼牙棒奶茶
1T测试工程师把酒吧拆了
一个测试工程师化装成老板走进一家酒吧,要了500杯啤酒,并且不付钱
一万个测试工程师在酒吧外呼啸而过
一个测试工程师走进一家酒吧,要了一杯<escape>
测试工程师们满意地离开了酒吧
然后一名顾客问厕所在哪儿,酒吧炸了
C++可视化数字大小
time2025/5/6
头文件
#ifndef ANALOGLITERALS_HPP
#define ANALOGLITERALS_HPP
namespace analog_literals {
typedef unsigned int uint;
// Symbols
enum line_end { o, I };
enum Lsymbol { L };
// Intermediary types used during construction
struct eLsymbol {};
eLsymbol operator! (Lsymbol) { return eLsymbol(); }
struct gen { template <typename T> operator T () const { return T(); } };
template <typename T, uint n> struct excls { excls<T, n + 1> operator! () const { return gen(); } };
template <typename T, uint n> struct dashes: excls<dashes<T, n>, 0>
{ dashes<T, n + 1> operator-- (int) const { return gen(); } };
template <typename, uint> struct L_symbols {}; // represents a L|L|L|.. series
template <typename T, uint n> L_symbols<T, n + 1> operator| (L_symbols<T, n>, Lsymbol) { return gen(); }
template <typename, uint> struct eL_symbols {}; // represents a !L|!L|!L|.. series
template <typename T, uint n> eL_symbols<T, n + 1> operator| (eL_symbols<T, n>, eLsymbol) { return gen(); }
dashes<line_end, 1> operator-- (line_end, int) { return gen(); }
excls<line_end, 1> operator! (line_end) { return gen(); }
// Result types
template <uint len> struct line: L_symbols<line<len>, 0>
{ static uint const length; operator uint () const { return len; } };
template <uint x, uint y> struct rectangle { static uint const width, height, area; };
template <uint x, uint y, uint z> struct cuboid { static uint const width, height, depth, volume; };
// Static members
template <uint len> uint const line<len>::length = len;
template <uint x, uint y> uint const rectangle<x, y>::width = x;
template <uint x, uint y> uint const rectangle<x, y>::height = y;
template <uint x, uint y> uint const rectangle<x, y>::area = x * y;
template <uint x, uint y, uint z> uint const cuboid<x, y, z>::width = x;
template <uint x, uint y, uint z> uint const cuboid<x, y, z>::height = y;
template <uint x, uint y, uint z> uint const cuboid<x, y, z>::depth = z;
template <uint x, uint y, uint z> uint const cuboid<x, y, z>::volume = x * y * z;
template <uint x, uint y, uint z> rectangle<x, y> front (cuboid<x, y, z>) { return gen(); }
template <uint x, uint y, uint z> rectangle<z, y> side (cuboid<x, y, z>) { return gen(); }
template <uint x, uint y, uint z> rectangle<x, z> top (cuboid<x, y, z>) { return gen(); }
// Equality
template <uint ax, uint bx> bool operator== (line<ax>, line<bx>) { return ax == bx; }
template <uint ax, uint ay, uint bx, uint by> bool operator== (rectangle<ax, ay>, rectangle<bx, by>)
{ return ax == bx && ay == by; }
template <uint ax, uint ay, uint az, uint bx, uint by, uint bz>
bool operator== (cuboid<ax, ay, az>, cuboid<bx, by, bz>) { return ax == bx && ay == by && az == bz; }
// Construction
// line
line<0> operator- (line_end, line_end) { return gen(); }
template <uint x> line<x> operator- (dashes<line_end, x>, line_end) { return gen(); }
// rectangle
template <uint x, uint y> struct lower_rectangle {}; // with lower right corner
template <uint excl_marks, uint x>
lower_rectangle<x, (excl_marks + 1) / 2> operator- (excls<dashes<line_end, x>, excl_marks>, line_end)
{ return gen(); }
template <uint x, uint y> rectangle<x, y> operator| (line<x>, lower_rectangle<x, y>) { return gen(); }
// cuboid
template <uint x, uint y, uint z> struct cuboid_top {};
template <uint x, uint y, uint z> struct half_cuboid {};
// dimensions of complete cuboid known, rest is for show
template <uint x, uint n>
cuboid_top<x, n + 1, n> operator| (L_symbols<line<x>, n>, line<x>) { return gen(); }
template <uint x, uint y, uint z, uint n>
eL_symbols<half_cuboid<x, y + (n + 1) / 3, z>, 0> // todo: assert: n%3=2
operator| (cuboid_top<x, y, z>, excls<line_end, n>) { return gen(); }
template <uint x, uint y, uint z>
cuboid<x, y, z> operator| (eL_symbols<half_cuboid<x, y, z>, z>, lower_rectangle<x, 1>) { return gen(); }
// Convenience namespaces that can be "using namespace"'d:
namespace symbols
{
using analog_literals::o;
using analog_literals::I;
using analog_literals::L;
}
namespace shapes
{
using analog_literals::line;
using analog_literals::rectangle;
using analog_literals::cuboid;
}
} // analog_literals
#endif // header guard
int main () {
using namespace analog_literals::symbols;
auto cubic = (
o-------------o
|L \
| L \
| L \
| o-------------o
| ! !
! ! !
o | !
L | !
L | !
L| !
o-------------o
);
std::cout << cubic.volume << std::endl; //108
auto square = (
o-------------o
| !
! !
! !
o-------------o
);
std::cout << square.area << std::endl; //18
auto line = (I-------------I);
std::cout << line << std::endl; //6
}
XKCD
收藏!
| ID | Title |
|---|---|
| 353 | Python |
| 2941 | 细胞器 |
| 2871 | Definitely |
| 3056 | RNA |
| 3064 | 肺鱼 |
PCwqyy

浙公网安备 33010602011771号