Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
bmcalc.cpp
Package: BusMath.rar [view]
Upload User: zhangbing
Upload Date: 2020-05-04
Package Size: 2k
Code Size: 1k
Category:
Static control
Development Platform:
Visual C++
- #include "StdAfx.h"
- #include "bmcalc.h"
- double Min(const double *Nbr, const int Total)
- {
- double Minimum = Nbr[0];
- for(int i = 0; i < Total; i++)
- if( Minimum > Nbr[i] )
- Minimum = Nbr[i];
- return Minimum;
- }
- double Max(const double *Nbr, const int Total)
- {
- double Maximum = Nbr[0];
- for(int i = 0; i < Total; i++)
- if( Maximum < Nbr[i] )
- Maximum = Nbr[i];
- return Maximum;
- }
- double Sum(const double *Nbr, const int Total)
- {
- double S = 0;
- for(int i = 0; i < Total; i++)
- S += Nbr[i];
- return S;
- }
- double Average(const double *Nbr, const int Total)
- {
- double avg, S = 0;
- for(int i = 0; i < Total; i++)
- S += Nbr[i];
- avg = S / Total;
- return avg;
- }
- long GreatestCommonDivisor(long Nbr1, long Nbr2)
- {
- while( true )
- {
- Nbr1 = Nbr1 % Nbr2;
- if( Nbr1 == 0 )
- return Nbr2;
- Nbr2 = Nbr2 % Nbr1;
- if( Nbr2 == 0 )
- return Nbr1;
- }
- }