C program: 找average, max, min

2011-11-24 5:07 am

{{{255,0,0}, {0,255,0}, {0,0,255}}, {{255,255,0}, {255,255,255}, {0,0,0}}}
Here are the data of RBG(Red, blue, green)
I want find the average of RBG, also max and min.

the output should be like this:
127, 127, 85, 0,0,0 , 255, 255 , 255
/*ave of R ave of B ave of G; min of RBG; max of RBG*/

/*ave= 255 * 3 / 6 */

回答 (2)

2011-11-28 5:20 am
✔ 最佳答案
fwsafasfcddddddddd
2011-11-28 1:42 pm
C (pronounced like the letter C) is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system.[4]Although C was designed for implementing system software,[5] it is also widely used for developing portable application software.C is one of the most widely used programming languages of all time[6][7] and there are very few computer architectures for which a C compiler does not exist. C has greatly influenced many other popular programming languages, most notably C++, which began as an extension to C.
CharacteristicsLike most imperative languages in the ALGOL tradition, C has facilities for structured programming and allows lexical variable scope and recursion, while a static type system prevents many unintended operations. In C, all executable code is contained within subroutines, which are called "functions" (although not in the strict sense of functional programming). Function parameters are always passed by value. Pass-by-reference is simulated in C by explicitly passing pointer values. C program source text is free-format, using the semicolon as a statement terminator and curly braces for grouping blocks of statements.The C language also exhibits the following more specific characteristics:There are a small, fixed number of keywords, including a full set of flow of control primitives: for, if, while, switch, and do..while. There is basically one namespace, and user-defined names are not distinguished from keywords by any kind of sigil.There are a large number of arithmetical and logical operators, such as +, +=, ++, &, ~, etc.More than one assignment may be performed in a statement.


收錄日期: 2021-04-13 18:22:18
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20111123000051KK00925

檢視 Wayback Machine 備份