/* * @(#) smt1_6.c - Program for calculation of the hitting factor of * some bombs, variant 2 (Task 1_6 at the Special Military Training course). * (c) 1996 Ivan Maidanski http://ivmai.chat.ru * Freeware program source. All rights reserved. ** * Language: ANSI C * Tested with: Borland C++ v3.1 * Last modified: 1996-12-06 16:10:00 GMT+03:00 */ #include #include #include float p[100]; int main() { int m,k,n,l,s,t; int i,j; randomize(); printf("Input M:\n"); scanf("%d",&m); printf("Input K:\n"); scanf("%d",&k); printf("Input N:\n"); scanf("%d",&n); for (i=0;i=k) l++; t+=s; } printf(" W=%f\n M[X]=%f\n\n",(float)l/n,(float)t/n); return 0; }