#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;}
Вес текста = 59 * 16 бит = 944.0 бит = 118.0 байт = 0.115234375 Кбайт = 0.0001125335693359375 Mбайт
2:
Вес текста = 16 * 30 * 32 * 16 бит = 245760.0 бит = 30720.0 байт = 30.0 Кбайт = 0.029296875 Mбайт
3:
Вес символа = 25 * 8 * 1024 бит / (8 * 40 * 64 бит) = 10.0 бит
4:
Вес текста = 1024 * 64 * 64 * 8 бит = 33554432.0 бит = 4194304.0 байт = 4096.0 Кбайт = 4.0 Mбайт
5:
Вес текста = 52 * 16 бит = 832.0 бит = 104.0 байт = 0.1015625 Кбайт = 9.918212890625e-05 Mбайт
6:
Вес текста = 16 * 35 * 64 * 8 бит = 286720.0 бит = 35840.0 байт = 35.0 Кбайт = 0.0341796875 Mбайт
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;}