C程序设计语言第二版1.20
来源:互联网 发布:公司seo是什么职位 编辑:程序博客网 时间:2024/05/21 06:45
#include<stdio.h>#define TABSIZE 8#define MAXLEN 200void detab(char *strsour,char *strobj);int main(){ char strsour[MAXLEN] = {0},strobj[MAXLEN] = {0}; int i = 0; char c; while((c = getchar()) != EOF){ strsour[i] = c; i++; } printf("%s",strsour); return 0;}void detab(char *strsour,char *strobj){ int k = 0,i = 0,j = 0,posofsour = 0,posofobj = 0; while(strsour[i] != '\0'){ if(strsour[i] == '\t'){ posofsour = posofsour + (TABSIZE - posofsour % TABSIZE); for(k = posofobj;k < posofsour;k++){ strobj[j] = ' '; j++; posofobj++; } }else if(strsour[i] != '\n'){ strobj[j] = strsour[i]; j++; posofobj++; posofsour++; }else{ posofobj = 0; posofsour = 0; strobj[j] = strsour[i]; j++; } i++; } strobj[j] = '\0';}
0 0
- C程序设计语言第二版1.20
- c程序设计语言第二版1.18
- C程序设计语言第二版1.21
- C程序设计语言(第二版 ) 读书笔记
- C程序设计语言(第二版)习题:第一章
- 【c程序设计语言(第二版)】素数
- 【c程序设计语言(第二版)学习】20160326
- C程序设计语言(第二版)-读书笔记
- c 程序设计语言 第二版 练习题 4-10
- c 程序设计语言 第二版 练习题 4-13
- c 程序设计语言 第二版 练习题 4-12
- c 程序设计语言 第二版 练习题 5-1
- c 程序设计语言 第二版 练习题 5-2
- c 程序设计语言 第二版 练习题 5-3
- c 程序设计语言 第二版 练习题 5-4
- c 程序设计语言 第二版 练习题 5-5
- c 程序设计语言 第二版 练习题 6-3
- c 程序设计语言 第二版 练习题 6-4
- Windows学习(003)--CreateFile
- 腾讯地图,百度地图,高德地图部分比较
- CTS 框架研究(2)-CTS环境调试 _源码导入eclipse
- 培训笔记
- Effiective C++条款第二条 尽量以const,enum,inline,替换#define
- C程序设计语言第二版1.20
- 南阳oj 题目 90 整数划分
- 字典操作
- xamarin学习笔记A01下(ios环境的安装)
- Protobuf3 系列三 更新Message类型
- 虚拟机搭建CDH-第六讲-安装mysql第二种方法(通过rpm包安装)
- SSH--Hibernate传值为乱码 || 显示为乱码
- 避免把情绪带进工作
- idea 新增lombok插件