#include <iostream>#include <time.h>#include <stdio.h>#include <stdlib.h>#define max 100using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char** argv) { srand(time(NULL)); int n , Chet = 0 ,notChet = 0 ,a[max]; cout<<"Size : "; cin>>n; for(int i = 0; i < n; i++) { a[i] = rand()%120+20; cout<<a[i]<<endl; if (a[i] %2 == 0) Chet++; else notChet++; } cout<<"Chet = "<<Chet<<", NotChet = "<<notChet; return 0;}
N = 2^i, где
N - количество цветов;
I - количество бит на цвет.
V = K*I, где
V - объем;
K - размер изображения.