// ConsoleApplication1.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "stdio.h" #include "conio.h" #include "math.h" #include "stdlib.h" float rand_exp(float); int main() { float QL = 0, LEC = 0, AEC = 0, SS = 0, Next_Arr, Next_dep; float div, darsad; Next_Arr = rand_exp(6); Next_dep = Next_Arr + rand_exp(10); if (Next_Arr < Next_dep) { if (SS == 0) { SS = 1; Next_Arr = Next_Arr + rand_exp(6); } else { if (QL == 9) { LEC++; Next_Arr = Next_Arr + rand_exp(6); } else { QL++; Next_Arr = Next_Arr + rand_exp(6); } } if (QL == 0) { SS = 0; Next_dep = Next_Arr + rand_exp(10); } else { QL--; Next_dep = Next_dep + rand_exp(10); } } while (AEC < 1000000); div = (LEC / 1000000); percent = div * 100; printf("\n %%[%.2f]\n", percent); getchar(); return 0; } float rand_exp(float s) { float a, b; a = ((float)rand() / RAND_MAX); b = ((-1)*(s))*log(a); printf("\n%.2f", b); return b; }