feat: Initial commit
This commit is contained in:
4
Lab04/evenFile.txt
Normal file
4
Lab04/evenFile.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
432
|
||||
65346
|
||||
3214
|
||||
856
|
||||
11
Lab04/inFile.txt
Normal file
11
Lab04/inFile.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
123
|
||||
432
|
||||
75
|
||||
1231231
|
||||
65346
|
||||
3245
|
||||
3214
|
||||
123
|
||||
6345
|
||||
856
|
||||
0
|
||||
6
Lab04/oddFile.txt
Normal file
6
Lab04/oddFile.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
123
|
||||
75
|
||||
1231231
|
||||
3245
|
||||
123
|
||||
6345
|
||||
10
Lab04/redir.c
Normal file
10
Lab04/redir.c
Normal file
@@ -0,0 +1,10 @@
|
||||
//usr/bin/gcc "$0" && ./a.out < inFile.txt 1> evenFile.txt 2> oddFile.txt; rm a.out; exit
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int n;
|
||||
while (scanf("%d", &n) != EOF && n != 0) {
|
||||
fprintf((n%2) ? stderr : stdout, "%d\n", n);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user