代码搜索结果
找到约 10,000 项符合
L 的代码
l30.1a
#print
Write a subroutine named "locn(s,c)" which expects two
arguments: the first is a pointer to characters 's' which
points to a null-terminated string, and the second
is a character 'c' which is t
l40.1a
#print
Write a subroutine
errmess(n)
which looks at its argument and prints
one of the following messages:
n message (follow it by a newline)
1 ?
2 syntax error
3 bad sy
l33.1a
#print
Write a main program which counts the number of command-line arguments
it has which begin with the letter 'b'. Print the
result in decimal. Compile and test it as usual.
Then type "ready".
#u
l0
#next
0.1a 10
l10
#print
The lessons from this point on are from the old C script.
They have not been cleaned up as much as they could, so some
are not very illuminating, and the code they illustrate
is not always the
l32.1a
#print
Write a program
pair(a,b)
which accepts as arguments two pointers to integers
and swaps the integers if necessary so that the
first argument points to the larger one; that is
int x,y;
x =
l9.1a
#print
(Section 1.9 -- read 1.6-1.8 too.)
Write a program that removes trailing blanks
and tabs from each line of input, and deletes
entirely blank lines. To make your job easier,
you can use the fun
l0.1a
#print
This script is loosely based on the material in
"The C Programming Language", by Brian Kernighan
and Dennis Ritchie (Prentice-Hall, 1978).
You may find it helpful to have that at hand.
Some of
l2.1a
#print
(Section 1.2)
The file Ref.c contains a copy of
a program to convert Fahrenheit to
Celsius. Modify it to print this
heading at the top:
Fahrenheit-Celsius Conversion
F: C:
Type ready when
l20.1a
#print
Write a program to read a list of positive numbers
and sort them into ascending order. Print
the sorted list of numbers one per line
as five digit numbers (%5d in printf).
Stop reading numbers