博客园人必备工具——消除行号

#include<stdio.h>
#include< string.h>
#include<stdlib.h>
void welcome()
{
    printf( " \t\t\t博客园人必备工具——消除行号\n ");
    printf( " \t\t\t\t  BY ma6174\n ");
    printf( " \t\t\t       ma6174@163.com ");
    printf( " \n使用方法:\n\n ");
    printf( " 先将你要消除行号的完整代码复制到这里,\n\n按一下回车键, ");
    printf( " 然后按“Ctrl + Z”组合键,再按一下回车,烦人的行号就全没啦\n "); 
     for( int i =  0; i <  80; i++)
    printf( " = ");
    printf( " \n\n ");
}
int main()
{
    welcome(); 
     char s[ 1000];
     int i,len,tag;
    FILE *fp;
    fp=fopen( " temp.txt ", " w ");
     if(fp==NULL){
        printf( " 文件打开失败! ");
        exit( 1);
    }
     while(gets(s))
    {
        len=strlen(s);
        i= 0;
         while(s[i]== '   ')i++;
         while(s[i]>= ' 0 '&&s[i]<= ' 9 ')i++;
         while(i<len- 1)
            fprintf(fp, " %c ",s[++i]);
        fprintf(fp, " \n ");
    }
    fclose(fp);
    system( " start temp.txt ");
}

转载于:https://www.cnblogs.com/zlf344242525/archive/2011/12/09/2282363.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值