博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[C puzzle book] Preprocessor for C
阅读量:7067 次
发布时间:2019-06-28

本文共 1047 字,大约阅读时间需要 3 分钟。

#include 
#define FUDGE(k) k+3.14159#define PR(a) printf("a= %d\t",(int)(a))#define PRINT(a) PR(a); putchar('\n')#define PRINT2(a,b) PR(a); PRINT(b)#define PRINT3(a,b,c) PR(a); PRINT2(b,c)#define MAX(a,b) (a
#include 
#define NEG(a)-a#define weeks(mins) (days(mins)/7)#define days(mins) (hours(mins)/24)#define hours(mins) (mins/60)#define mins(secs) (secs/60)#define TAB(c,i,oi,t) if(c=='\t')\ for(t=8-(i-oi-1)%8,oi=i; t; t--)\ putchar(' ')#define PR(a) printf(#a"=%d\t",(int)(a))#define PRINT(a) PR(a); putchar('\n')int main(void){ { int x=1; PRINT( -NEG(x) ); } { PRINT(weeks(10080)); PRINT(days(mins(86400))); } { static char input[]="\twihch\tif?"; char c; int i, oldi, temp; for(oldi=-1,i=0; (c=input[i])!='\0'; i++) if (c<' ') TAB(c,i,oldi,temp); else putchar(c); putchar('\n'); }}

转载于:https://www.cnblogs.com/abacuspix/archive/2012/08/10/2631744.html

你可能感兴趣的文章
浅谈C#中的延迟加载“.NET研究”(1)——善用委托
查看>>
VS“.NET研究”2010测试功能之旅:编码的UI测试(1)
查看>>
接口库设计总结
查看>>
redis查看数据
查看>>
DFS ( 深度优先/回溯算法 ) 一
查看>>
Enum一点使用总结
查看>>
eclipse +VISUALSVN SERVER 创建版本控制器,防止误操作(可视化操作,简单方便,不需要修改配置文件)...
查看>>
一致性hash
查看>>
C++函数的重载
查看>>
WPF自定义控件与样式(9)-树控件TreeView与菜单Menu-ContextMenu
查看>>
苹果应用的上线步骤
查看>>
初识scoket
查看>>
Stardew Valley(星露谷物语)Mod开发之路 1环境配置
查看>>
2012 借教室
查看>>
为什么是Spring Boot
查看>>
python基础-协程
查看>>
JavaScript数据类型
查看>>
hdu 2844 混合背包【背包dp】
查看>>
函数分析题
查看>>
debian手册摘要
查看>>