ответ: Я так понимаю, никто не давать ответы на такие вопросы :D
1.
#include <iostream>
using namespace std;
int main()
{
long long i = 35, j = 31, sum = 0;
while(i)
{
if(j % 2)
{
sum += j;
i--;
}
j++;
}
cout << sum << endl;
return 0;
}
ответ: 2275
2.
#include <iostream>
using namespace std;
int main()
{
unsigned long long i = 35, j = 38, sum = 1;
while(i--)
{
sum *= j;
j++;
}
cout << sum << endl;
return 0;
}
ответ: 9776069387944460288
3.
#include <iostream>
using namespace std;
int main()
{
long long n, i = 1, n1, ans = 0;
cin >> n;
n1 = n/2;
while(i <= n1)
{
if(!(n % i))
ans++;
i++;
}
cout << ans << endl;
return 0;
}
4.
#include <iostream>
using namespace std;
int main()
{
long long m, k, ans = 0;
cin >> m >> k;
for(; m <= k; m++)
if(m % 5 == 0)
ans++;
cout << ans << endl;
return 0;
}
Объяснение:
1)
var
str : string;
begin
readln (str);
writeln (length (str) - pos (':', str));
end.
2)
var
str, s : string;
count, i : integer;
begin
readln (str);
s := copy (s, pos ('(', str) + 1, pos (')', str) - pos ('(', str) - 1);
count := 0;
for i := 1 to length (s) do
if s[i] = ' ' then inc (count);
writeln (count + 1);
end.
3)
var
str : string;
count : integer;
begin
readln (str);
count := 0;
while pos (',', str) > 0 do
begin
inc (count);
delete (str, pos (',', str), 1);
end;
writeln (str);
writeln (count);
end.
Сделано без проверки на соответствие условию.