#include <iostream>
#include <string>
#include <Windows.h>
signed main() {
const int SIZE = 256;
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
int counts[SIZE] = {};
std::string str;
getline(std::cin, str);
int len = str.length();
/*
Цикл для подсчета повторений каждого символа в тексте
*/
for (int i = 0; i < len; i++) {
counts[(int)(str[i])]++;
}
/*
Цикл для вывода результата
*/
for (int i = 0; i < SIZE; i++) {
if (counts[i] > 0)
std::cout << "Количество повторений символа " << (char)i << ": " << counts[i] << std::endl;
}
return 0;
}
Program SumAndMul;
Uses Crt;
var a:array[1..10] of real;
i:integer;
sum,mul:longint;
begin
clrscr;
for i:=1 to 10 do
begin
write('Введите -', i,' число:' );
readln(a[i]);
end;
sum:=0;mul:=1;
for i:=1 to 10 do
begin
if (a[i]>0) then sum:=sum+a[i];
if (a[i]<0 ) then mul:=mul*a[i];
end;
writeln('Сумма положительных элементов: ',sum);
writeln('Произведение отрицательных элементов: ',mul);
readkey;
end.
50 Кб=50000 байт. 50×1000=50000
Объяснение:
Өйткені жедел жадының әрбір ұяшығының өлшемі 10Кб тең деп жазылып тұр.