N=2^i
16=2^i
i=4 бита на 1 символ в первом случае
8=2^i
i=3 бита на 1 символ во втором случае
Количество символов в сообщении неизменно
4k-3k=800
k=800 количество символов
Конъюкцию (and). Поскольку одно из условий оператора if (а>1) всегда равно 1. а другое (а<b) всегда нулю, то результат <span>(a > 1) and (a < b) будет 0 и переменная а получит приращение в 7
</span>a := 10; b := 5;
<span>if (a > 1) and (a < b) then </span>
a := a - 7
else
<span>a := a + 7;</span>
Var s:string; k,i:integer;
begin
write('Введите строку:');
readln(s);
k:=0;
for i:=1 to length(s) do
if (s[i]>='0')and(s[i]<='9') then k:=k+1;
writeln('k = ',k);
end.
Пример:
<span>Введите строку:
13 апреля 2016 г .
k = 6</span>
Решение в прикрепленном графическом файле
Насчёт С не знаю, но на С++ (а значит, наверное, и на С) так:
#include <iostream>
#include <stdio.h>
using std::cout;
using std::endl;
typedef enum { enSuccess, enWrongCmdLine, enFileOpenError } __ExitCodes;
int main(int argc, char **argv)
{
if(argc != 3) { cout<<"Usage: "<<argv[0]<<" <in_file> <out_file>"<<endl; return enWrongCmdLine; }
FILE *_inFile = fopen(argv[1], "r+b"); if(_inFile == 0) { cout<<"Cannot open input file "<<argv[1]<<endl; return enFileOpenError; }
FILE *_outFile = fopen(argv[2], "w+b");
if(_outFile == 0)
{
cout<<"Cannot open output file "<<argv[2]<<endl;
fclose(_inFile);
return enFileOpenError;
}
char *_buffer[1024];
while(!feof(_inFile) fwrite(_buffer, fread(_buffer, sizeof(_buffer), 1, _inFile), 1, _outFile);
fclose(_inFile); fclose(_outFile);
return enSuccess;
}