Program P7;
var S:String; n,k1,k2,k3,i:byte;
Begin
writeln('Введите строку:');
readln (S);
n:=length (S);
k1:=0; k2:=0; k3:=0;
For i:=1 to n do
case S[I] of
' ' : k1:=k1+1;
',',';','.','!',':','?' : k2:=k2+1;
'b','c','d','f','g','k','l','m','n','p','r','s','t': k3:=k3+1
end;
Writeln ('kolicestvo clov = ',k1+1);
Writeln ('kolicestvo znakov prepinania = ',k2);
writeln('kolicestvo soglasnih = ', k3);
readkey
end.
Пример:
Введите строку:
na ulite sneg.
kolicestvo clov = 3
kolicestvo znakov prepinania = 1
kolicestvo soglasnih = 6
Function func1(a As Double) As Double
Dim i As Integer, b As Double
i = 1 - Sgn((Abs(a) - a) / 2)
b = Sqr(a * i)
a = a * 2 + i * (b - 2 * a)
func1 = a
End Function
сама программа здесь
просто поменяй расширение
#include <stdio.h>
int main()
{
int x, y, z, min, max;
printf("Введите x и y:\n");
scanf("\%d \%d", &x, &y);
if (x<y) min = x; else min = y;
if (x*y>x+y) max = x*y; else max = x+y;
printf("min = \%d max = \%d\n",min,max);
z = min+max;
printf("z = \%d",z);
system("pause");
return 0;
}
Пример:
<span>Введите x и y:
10 45
min = 10 max = 450
z = 460</span>