Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3602
  • 博文数量: 1
  • 博客积分: 46
  • 博客等级: 民兵
  • 技术积分: 20
  • 用 户 组: 普通用户
  • 注册时间: 2012-08-13 21:22
文章分类
文章存档

2012年(1)

我的朋友
最近访客

分类: C/C++

2012-08-13 22:38:20

 

Source Code 很好很强大~ 不过好像没找到折叠功能~

1: #include 2: int main() 3: { 4: printf("Hello World!\n"); 5: return 0; 6: } 7: 1: /* 2: * A simple code to filter the C/C++ source code. 3: * Copyright (c) 2007 freebsd13 4: */ 5: #include 6: 7: using namespace std; 8: 9: int main() 10: { 11: char ch,ch1= 0; 12: while(cin.get(ch)) 13: { 14: if(ch == '/') 15: { 16: cin.get(ch); 17: switch(ch) 18: { 19: case '/': 20: do{ 21: cin.get(ch); 22: }while(ch!='\n'); 23: cout<break; 25: case '*': 26: do{ 27: cin.get(ch); 28: cin.get(ch1); 29: cin.putback(ch1); 30: }while(!(ch == '*'&&ch1 == '/')); 31: cin.get(ch);//吃掉放回去的字符 32: 33: break; 34: default: 35: cout<<'/'; 36: cout<else 39: cout<return 0; 42: }

SyntaxHighligher   好像对于C 不加亮 很是简单

#include int main() { printf("Hello World!\n"); return 0; }

C++

/* * A simple code to filter the C/C++ source code. * Copyright (c) 2007 freebsd13 */ #include using namespace std; int main() { char ch,ch1= 0; while(cin.get(ch)) { if(ch == '/') { cin.get(ch); switch(ch) { case '/': do{ cin.get(ch); }while(ch!='\n'); cout<

 

 

用Windows Live Writer 的代码插件无一例外都失败了·看来支持还不是很好。


点击(此处)折叠或打开

  1. /*
  2. * A simple code to filter the C/C++ source code.
  3. * Copyright (c) 2007 freebsd13 <freebsd13@163.com>
  4. */
  5. #include <iostream>

  6. using namespace std;

  7. int main()
  8. {
  9.     char ch,ch1= 0;
  10.     while(cin.get(ch))
  11.     {
  12.         if(ch == '/')
  13.         {
  14.             cin.get(ch);
  15.             switch(ch)
  16.             {
  17.             case '/':
  18.                 do{
  19.                     cin.get(ch);
  20.                 }while(ch!='\n');
  21.                 cout<<ch;
  22.                 break;
  23.             case '*':
  24.                 do{
  25.                     cin.get(ch);
  26.                     cin.get(ch1);
  27.                     cin.putback(ch1);
  28.                 }while(!(ch == '*'&&ch1 == '/'));
  29.                 cin.get(ch);//吃掉放回去的字符

  30.                 break;
  31.             default:
  32.                 cout<<'/';
  33.                 cout<<ch;
  34.             }
  35.         }else
  36.             cout<<ch;
  37.     }
  38.     return 0;
  39. }

用ChinaUnix 的毫无疑问OK 但是要是离线编写就比较不知所措了。
阅读(359) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:没有了

给主人留下些什么吧!~~