Write a program to copy its input to its output, replacing each tab by \t, each backspace by \b, and each backslash by \\. This makes tabs and backspa
2013-09-17 18:57
465 查看
#include <stdio.h> #define DBS '\\' void main() { int c; while((c=getchar())!=EOF) { if(c=='\t') { putchar(DBS); putchar('t'); } else if(c==' ') { putchar(DBS); putchar('b'); } else if(c=='\\') { putchar(DBS); putchar(DBS); } else putchar(c); } printf("\n%d\n",c); }
jh fhj jkhfh\ jh\bfhj\t\bjkhfh\\
相关文章推荐
- Write a program to copy its input to its output, replacing each string of one or more blanks by a single blank.
- Linux tip - How to create a file and write by script?
- EWB使用时出错-unable to write EWB program directory please change the permissions of this directory
- Bug on Build Solution: "Unable to copy file... because it is being used by another process.."
- VS ERROR LNK 1201 ,LINK could not write to the program database (PDB) for the output file
- [每日练习] write a function to find the key in a m*n matrix, where each line and column is incremental
- Input and Output(easy to use)
- 笔试题:Suggest a simple and fast way to multiply the input integer digit by 7。
- How To Read and Write BLOB Data by Using ADO.NET with Visual C# .NET
- how to write order by and limit query in jpa [duplicate]
- What is SPAWN concurrent program and how to write such program?
- Slow performance occurs when you copy data to a TCP server by using a Windows Sockets API program
- How To Open Physical Standby For Read Write Testing and Flashback
- It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing ___Error Installing APK
- This tag and its children can be replaced by one <TextView/> and a compound drawable
- Adding Keyword And Description meta tags to each page by inheritence
- Maven: Maven Antrun Plugin configuration to copy package from target to basedir and rename it
- Write a program that prints its input one word per line.
- Get json formatted string from web by sending HttpWebRequest and then deserialize it to get needed data
- 【Testable Code】Unit Tests, How to Write Testable Code and Why it Matters