/*
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 backspaces visible
in an unambiguous way.
*/
#inclu...
分类:
其他好文 时间:
2015-07-12 20:25:20
阅读次数:
93
/*
Write a program to print the value of EOF.
*/
#include
main()
{
printf("EOF is %d\n", EOF);
}
/*
Output:
EOF is -1
*/...
分类:
其他好文 时间:
2015-07-12 20:24:24
阅读次数:
103
/*
Write a program to count blanks, tabs, and newlines.
*/
#include
/* count blanks, tabs, and newlines */
main()
{
int c, nb, nt, nl;
nb = 0; /* number of blanks */
nt = 0; /* number of t...
分类:
其他好文 时间:
2015-07-12 20:23:41
阅读次数:
103
/*
Write a program to copy its input to its output, replacing each string of one or
more blanks by a single blank.
*/
#include
#define NONBLANK 'a'
/* replace string of blanks with a single blank...
分类:
其他好文 时间:
2015-07-12 20:22:41
阅读次数:
127
/*
Verify that the expression getchar() != EOF is 0 or 1.
*/
#include
main()
{
int c;
while(c = getchar() != EOF)
{
printf("%d\n", c);
}
printf("%d - at EOF\n", c);
}...
分类:
其他好文 时间:
2015-07-12 19:02:18
阅读次数:
145
/*
Modify the temperature conversion program to print the table in reverse order,
that is, from 300 degrees to 0.
*/
#include
/* print Fahrenheit-Celsius table in reverse order */
main()
{
int...
分类:
其他好文 时间:
2015-07-11 20:16:44
阅读次数:
164
/*
Write a program to print the corresponding Celsius to Fahrenheit table.
*/
#include
/* print Celsius-Fahrenheit table for celsius = 0, 20, ..., 300; floating-point
version */
main()
{
float...
分类:
其他好文 时间:
2015-07-11 20:14:23
阅读次数:
176
/*
Run the "hello, world" program on your system. Experiment with leaving out parts of the program to see what error messages you get.
*/
#include
main()
{
printf("hello world\n");
}...
分类:
其他好文 时间:
2015-07-11 18:31:13
阅读次数:
107
/*
Experiment to find out what happens when printf's argument string contains \c, where c is some character not listed above.
*/
#include
main()
{
printf("hello world\y");
printf("hello wor...
分类:
其他好文 时间:
2015-07-11 18:27:26
阅读次数:
137
/*
Modify the temperature conversion program to print a heading above the table.
*/
#include
/* print fahrenheit-Celsius table for fahr = 0, 20, ..., 300; floating-point
version */
main()
{
fl...
分类:
其他好文 时间:
2015-07-11 18:26:47
阅读次数:
147