Bell 32V development
[unix-history] / usr / lib / learn / C / L5.2e
#print
(Section 1.5)
Write a program which copies its input to its output
doubling each character (i.e. each input character
is written twice on the output). Compile and test
it. Then type ready. Don't forget
\b#include <stdio.h>
at the beginning of your program, and
cc x.c -lS
to compile it.
#once #create Ref
hoboken harrison newark roseville avenue grove street
east orange brick church orange highland avenue
mountain station south orange maplewood millburn short hills
summit chatham madison convent station morristown
new providence murray hill berkeley heights
gillette stirling millington lyons basking ridge
bernardsville far hills peapack gladstone
#once #create Answer
hhoobbookkeenn hhaarrrriissoonn nneewwaarrkk rroosseevviillllee aavveennuuee ggrroovvee ssttrreeeett
eeaasstt oorraannggee bbrriicckk cchhuurrcchh oorraannggee hhiigghhllaanndd aavveennuuee
mmoouunnttaaiinn ssttaattiioonn ssoouutthh oorraannggee mmaapplleewwoooodd mmiillllbbuurrnn sshhoorrtt hhiillllss
ssuummmmiitt cchhaatthhaamm mmaaddiissoonn ccoonnvveenntt ssttaattiioonn mmoorrrriissttoowwnn
nneeww pprroovviiddeennccee mmuurrrraayy hhiillll bbeerrkkeelleeyy hheeiigghhttss
ggiilllleettttee ssttiirrlliinngg mmiilllliinnggttoonn llyyoonnss bbaasskkiinngg rriiddggee
bbeerrnnaarrddssvviillllee ffaarr hhiillllss ppeeaappaacckk ggllaaddssttoonnee
#user
a.out <Ref >xxx
#cmp Answer xxx
#succeed
/* One way: */
\b#include <stdio.h>
main()
{
int c;
while ((c = getchar()) != EOF) {
putchar(c);
putchar(c);
}
}
#log
#next
5.1e 5
5.3e 2