mirror of
https://github.com/krislamo/knrc.git
synced 2025-04-18 06:34:22 +00:00
Compare commits
No commits in common. "93acdbe7e9a87c196bdc6282ad6751daccc75707" and "fe248c5a30276c3485d46e9240743528abf10f52" have entirely different histories.
93acdbe7e9
...
fe248c5a30
@ -1,12 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
/* Exercise 1-6 and 1-7 */
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
int c;
|
|
||||||
|
|
||||||
printf("EOF = %d\n", EOF);
|
|
||||||
|
|
||||||
while (c = getchar() != EOF)
|
|
||||||
printf("c = %d\n", c);
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
double nc;
|
|
||||||
|
|
||||||
for (nc = 0; getchar() != EOF; ++nc)
|
|
||||||
;
|
|
||||||
printf("%.0f\n", nc);
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
int c, b, t, n;
|
|
||||||
|
|
||||||
b = 0;
|
|
||||||
t = 0;
|
|
||||||
n = 0;
|
|
||||||
while ((c = getchar ()) != EOF) {
|
|
||||||
if (c == ' ')
|
|
||||||
++b;
|
|
||||||
if (c == '\t')
|
|
||||||
++t;
|
|
||||||
if (c == '\n')
|
|
||||||
++n;
|
|
||||||
}
|
|
||||||
printf("blanks = %d\n", b);
|
|
||||||
printf("tabs = %d\n", t);
|
|
||||||
printf("newlines = %d\n", n);
|
|
||||||
}
|
|
11
Makefile
11
Makefile
@ -1,4 +1,4 @@
|
|||||||
all: hello mathvars c2f input count countlines
|
all: hello mathvars c2f
|
||||||
|
|
||||||
hello: 01-hello-world.c
|
hello: 01-hello-world.c
|
||||||
gcc -o ./bin/01-helloworld 01-hello-world.c
|
gcc -o ./bin/01-helloworld 01-hello-world.c
|
||||||
@ -9,14 +9,5 @@ mathvars: 02-vars-and-math.c
|
|||||||
c2f: 03-celsius-to-fahrenheit.c
|
c2f: 03-celsius-to-fahrenheit.c
|
||||||
gcc -o ./bin/03-c2f 03-celsius-to-fahrenheit.c
|
gcc -o ./bin/03-c2f 03-celsius-to-fahrenheit.c
|
||||||
|
|
||||||
input: 04-file-copying.c
|
|
||||||
gcc -o ./bin/04-input 04-file-copying.c
|
|
||||||
|
|
||||||
count: 05-char-counting.c
|
|
||||||
gcc -o ./bin/05-count 05-char-counting.c
|
|
||||||
|
|
||||||
countlines: 06-line-count.c
|
|
||||||
gcc -o ./bin/06-line-count 06-line-count.c
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) ./bin/*-*
|
$(RM) ./bin/*-*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user