Program zna4enie;
var a, b, c,rez:integer;
begin
writeln('Введите первую цифру');
readln(a);
writeln('Введите вторую цифру');
readln(b);
writeln('Введите третью цифру');
readln(c);
rez:=(a div b+b)mod c;
writeln('(' ,a,' div ', b,'+ ',b,' )mod ',c);
write('Ответ: ',rez);
end.
Написать програму которая считывает текст с клавиатуры, находит самое длинное число и определяет, сколько раз оно встретилось в тексте.
Код C++
#include <conio.h>
#include <stdio.h>
#include <string.h>
#include <iostream.h>
void main();
{clrscr();
char s[50];
char s1{}=" ";
char *p;
char *q;
char e[50];
int g,a;
cout<<"vvedite tekst:"<<endl<<endl;
gets(s);
p=strtok(s,s1);
while(p)
{if(*p==' ')
p=strtok(s,s1);
g=strlen(p);
cout<<endl<<g<<endl;
if(a<g)
{a=g;
*e=*p;
}
p=strtok(NULL,s1);
}
puts(e);
cout<<endl<<e;
getch();
}
#include <iostream>
#include <cmath>
float f(float x);
int main()
{
float x;
std::cout << "Введите x: ";
std::cin >> x;
std::cout << "y=" << f(x);
}
float f(float x)
{
float a = 3.6F;
float b = 1.7F;
if (6 < x && x <= 8)
return (exp(a*x) + exp(-b*x)) / 2;
else if (x <= 6)
return sin(a*x) + 2;
else
return pow(cos(b*x), 2);
}
Трансляция.............................................................