编程介的小学生 2017-03-06 17:59 采纳率: 20.5%
浏览 861
已采纳

#define

We can use '#define' to define macro in C programming language. Now the task for you is to replace the macro by its actual content. Notice that we can use '#undef' to undefine a marco. Do NOT pay any attention to the detail of the program written in the input file, for there may be mistakes. Keep in mind that all you should be concerned about is '#define' and '#undef'.

Input

There are multiple test cases, each represents a program, which begins with the string "//PROGRAMBEGIN" in a single line, ends with the string "//PROGRAMEND" in a single line. It is guaranteed that,

1) the '#define' or '#undef' sentence is in one line, and '#' is at leftmost position of the line,

2) there is not any constant string in the program, and all the characters in the input file are either alpha characters ('A'-'Z','a'-'z'), numbers('0'-'9'), or character in "#/+:\t\n", and

3) the '#define' and '#undef' is always right, that is, a marco is never redefined and an inexistent marco is never undefined.

4) There are 20 macros in a program at most.

Output

For each test case, you should output the program with all the marcos replaced by its real content. Leave alone the format of the part that has no relation with any marcos. Obtain more information from the sample output.

Print 20 dashes after each test case.

Sample Input

//PROGRAMBEGIN
#define ZOJ Zhejiang University Online Judge
ZOJ
//PROGRAMEND

//PROGRAMBEGIN
#define ACM Association for Computing Machinery
#define ICPC International Collegiate Programming Contest
ACM ICPC
#undef ACM
ACM ICPC
//PROGRAMEND

Smaple Output

#define ZOJ Zhejiang University Online Judge

Zhejiang University Online Judge

#define ACM Association for Computing Machinery
#define ICPC International Collegiate Programming Contest
Association for Computing Machinery International Collegiate Programming Contest
#undef ACM

ACM International Collegiate Programming Contest

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-03-12 23:59
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏