From 70fbe7822024d0acc68df3607ff25bf8d7a71751 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 16 Jun 2005 23:19:27 +0000 Subject: initial import (automatically generated log message) --- statgen/test.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 statgen/test.c (limited to 'statgen/test.c') diff --git a/statgen/test.c b/statgen/test.c new file mode 100644 index 0000000..936b491 --- /dev/null +++ b/statgen/test.c @@ -0,0 +1,84 @@ +#include +#include "charset_auto_russian.h" + +main(int argc, char *argv[]) { + FILE *f; + int len,st; + char word[256],phrase[8192]; + unsigned long a[4]={0,0,0,0}; + int i,max,mw; + + + if ((argc!=2)&&(argc!=3)) { + printf("Usage: %s []\n",argv[0]); + exit(0); + } + + if (argc==3) mw=atoi(argv[2]); + else mw=1; + + f=fopen(argv[1],"r"); + if (!f) { + printf("Failed to open specified file. Check permissions!\n"); + exit(1); + } + + while(!feof(f)) { + strcpy(phrase,""); + for (i=0;ia[1]) { + if (a[0]>a[2]) max=0; + else max=2; + } else { + if (a[1]>a[2]) max=1; + else max=2; + } + if (a[3]>max) max=3; + + f=fopen(argv[1],"r"); + while(!feof(f)) { + strcpy(phrase,""); + for (i=0;i