/* * @(#) smt2_5.c - Program for calculation of effectiveness of the radar * station as a system of queuing using the method of statistical tests * (Task 2_5 at the Special Military Training course). * (c) 1997 Ivan Maidanski http://ivmai.chat.ru * Freeware program source. All rights reserved. ** * Language: ANSI C * Tested with: Borland C++ v3.1 * Last modified: 1997-05-04 17:00:00 GMT+04:00 */ #include #include #include #include #define NN 5000 #define MAX_N 10 float primary_stream(float lambda) { int xi; while (!(xi=rand())); return (-log((float)xi/RAND_MAX)/lambda); } int main(void) { int n; float lambda,tau; int p[MAX_N+1]; float t[MAX_N]; float dt; int i,j,s; printf("n= "); scanf("%d",&n); printf("Lambda= "); scanf("%f",&lambda); printf("ServiceTime= "); scanf("%f",&tau); printf("\n"); randomize(); for (i=0;i<=n;i++) p[i]=0; for (i=0;idt ? t[i]-dt : 0.0; for (i=0,s=0;i