题目,为以下程序写一个主函数,并查看展开式和输出结果: #include "stdio.h" #define NL putchar('\n') #define PR(format,value) printf("value=%format\t",(value)) //%f是固定格式,双引号里出现相同字符不进行替换 #define PRINT1(f,x1) PR(f,x1);NL #define PRINT2(f,x1,x2) PR(f,x1);PRINT1(f,x2) #define AA i am student #define N(x) printf(" x \n") #define BB "i am a student" #define M(x) printf(x)
使用方法及结果如下:(如有帮助,请采纳一下,谢谢)。
#include "stdio.h"
#define NL putchar('\n')
#define PR(format,value) printf("value=%format\t",(value)) //%f是固定格式,双引号里出现相同字符不进行替换
#define PRINT1(f,x1) PR(f,x1);NL
#define PRINT2(f,x1,x2) PR(f,x1);PRINT1(f,x2)
#define AA i am student
#define N(x) printf(" x \n")
#define BB "i am a student"
#define M(x) printf(x)
int main()
{
NL;
PR("%f",2.3);
PRINT1("%f",2.3);
PRINT2("%f",4.5,3.6);
N(AA);
N(2);
M(BB);
getchar();
getchar();
}
运行结果:
您好,我是有问必答小助手,您的问题已经有小伙伴解答了,您看下是否解决,可以追评进行沟通哦~
如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~
ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632