-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathENT.c
57 lines (46 loc) · 1.36 KB
/
ENT.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//---------------------------------------------------------------------------| ENT by Dietmar SCHRAUSSER 2010
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
void _profil();
void _kopf();
main(int argc, char *argv[])
{
FILE *in, *out1, *out2;
char x_[50];
if (argc != 4) {printf("\n> check arguments\n");_profil(); }
in=fopen( argv[1], "r" );
out1=fopen( argv[2], "w" );
out2=fopen( argv[3], "w" );
_kopf();
while(1)
{
fscanf(in,"%s",&x_ );if (feof (in) != 0) break;
fprintf(out1,"%s\n",x_);
fscanf(in,"%s",&x_ );
fprintf(out2,"%s\n",x_);
}
fclose(in);
fclose(out1);
fclose(out2);
return 0;
}
void _profil()
{
printf("--------------------------------------\n");
printf("Usage: ENT [input] [output1] [output2]\n");
printf("[input] ..... Eingabe Datei \n");
printf("[output1] ... Ausgabe Datei 1 \n");
printf("[output2] ... Ausgabe Datei 2 \n");
printf("--------------------------------------\n");
printf("ENT by Dietmar Schrausser\n");
printf("compiled on %s @ %s\n", __DATE__, __TIME__);
exit(0);
}
void _kopf()
{
printf("\nENT by Dietmar Schrausser\n");
printf("compiled on %s @ %s\n", __DATE__, __TIME__);
printf("computing ENT:\n");
}