摘要: 大概能理解题目意思,程序需要检测,输入的内容中,括号对等(检测到头括号,必须要检测到尾括号对应,否则报错),引号对称等处理内容。 1 #include 2 3 int brace, brack, paren; 4 5 void in_quote(int c); 6 void in_comment(viod); 7 void search(int c); 8 9 /* rudimentary syntax checker for C programs*/10 11 main()12 {13 int c;14 extern int brace, brack, paren;1... 阅读全文
posted @ 2013-10-27 16:41 _Jango 阅读(1094) 评论(0) 推荐(0) 编辑
摘要: 由于没能理解题目意思 ,直接看看答案。 1 #include 2 3 4 void rcomment(int c); 5 void in_comment(void); 6 void echo_quote(int c); 7 8 /* remove all comment form a valid C program*/ 9 10 11 main()12 {13 int c, d;14 while ((c = getchar()) != EOF)15 16 rcomment(c);17 return 0;18 }19 20 21 /* rcomment : rea... 阅读全文
posted @ 2013-10-27 15:14 _Jango 阅读(1170) 评论(0) 推荐(0) 编辑