C语言的格式化输入练习
2010-03-16 21:12
267 查看
看到了一个联系题,问题是如何格式化输出%.自己写了一个测试程序。对程序%输出进行测试。代码如下(用两个%,即可输出一个%):
#include <stdio.h>
int main()
{
printf("%%\"\n");
printf("Hello World\n");
return 1;
}在shell输出的结果如下:
xiaopeng@xiaopeng-desktop:~/test$ gcc -o format.o format.c
xiaopeng@xiaopeng-desktop:~/test$ ./format.o
%"
Hello World
xiaopeng@xiaopeng-desktop:~/test$
#include <stdio.h>
int main()
{
printf("%%\"\n");
printf("Hello World\n");
return 1;
}在shell输出的结果如下:
xiaopeng@xiaopeng-desktop:~/test$ gcc -o format.o format.c
xiaopeng@xiaopeng-desktop:~/test$ ./format.o
%"
Hello World
xiaopeng@xiaopeng-desktop:~/test$
相关文章推荐
- c语言练习 6-0. 混合类型数据格式化输入
- C语言格式化输入输出
- 前期C语言回顾 进制、C数据类型、常量变量、运算符、表达式、格式化输入输出
- C语言编程(练习3:字符输入和输出 )
- C语言中scanf格式化输入函数
- 【C语言小练习】 任意输入N个数,输出其由大到小的数据。
- C语言格式化输入输出
- C语言中scanf格式化输入函数
- C语言实验——格式化输出(常量练习)
- C语言学习笔记——格式化输入输出
- 【学习ios之路:C语言】数据类型、常量变量、运算符、表达式、格式化输入输出
- 【转载】C语言中scanf格式化输入函…
- C语言编程练习(通过指针调换输入数字)
- C语言练习--求一批整数中出现最多的个位数字(输入非负整数)
- 关于C语言基本格式化输入、输出 (如%20[^#] )这种不常见的写法说明
- C语言(六):格式化输出与输入函数
- C语言格式化输入输出DEMO
- C Primer Plus 第4章 字符串和格式化输入/输出 编程练习
- C语言---程序的一般形式、数据类型、常量变量、运算符、表达式、格式化输入输出
- C语言:P13练习——如何将多个空格输入一个