Сканируется цветное изображение размером 10x10 см. разрешающая сканера 300x300 dpi, глубина цвета - 3 байта. какой информационный объем будет иметь полученный графический файл?
#include <iostream> #include <sstream> #include <fstream> #include <string> #include <vector> #include <deque> #include <queue> #include <stack> #include <set> #include <map> #include <algorithm> #include <functional> #include <cstring> #include <utility> #include <bitset> #include <cmath> #include <cstdlib> #include <ctime> #include <cstdio> #include <climits>typedef unsigned long long ulol; typedef long long lol; typedef long int li;#define mp make_pair #define F first #define S second #define sqr(a) ( (a) * (a) ) #define pb push_back #define INF 999999999 #define ret(a) cout << endl; system("pause"); return(a) //#define ret(a) return(a)using namespace std;int main() { string s; cin >> s; cout << 1 << s << 1; ret(0); }
Ирина-Макаркина253
24.02.2020
#include <iostream> #include <iomanip> using namespace std;
int main() { int n,k; cout<<"n = "; cin>>n; int a[n],b[n]; srand(time(NULL)); // запись в массив for (int i=0; i<n; i++) { a[i]=15-rand()%30; cout<<a[i]<<" "; } cout<<endl; // сортировка массива по убыванию for (int i=0; i<n-1; i++) for (int j=i+1; j<n; j++) if (a[j]>a[i]) swap(a[i],a[j]); // поиск первого отрицательного k=0; while (a[k]>=0) k++; // запись положительных по убыванию for (int i=0; i<k; i++) b[i]=a[i]; // запись отрицательных по возрастанию for (int i=k; i<n; i++) b[i]=a[n-i+k-1]; // вывод массива b for (int i=0; i<n; i++) cout<<b[i]<<" "; cout<<endl; system("pause"); return 0; }
Сканируется цветное изображение размером 10x10 см. разрешающая сканера 300x300 dpi, глубина цвета - 3 байта. какой информационный объем будет иметь полученный графический файл?
a=10 см
b=10 см
K_1=300×300 dpi
i=24 bit
------------------
I - ?
I=K*i
1 дюйм = 2,54 см
a=b=10 см=10/2,54=3,94 дюйм
K=K_1ab=300×300 dpi*3,94 дюйм*3,94 дюйм=1397124
I=1397124*24 бит=33530976 бит ≈ 64 Мбайт
Ответ: I≈64 Мбайт