Var
N,A:integer;
Begin
Write('N = ');Read(N);
A:=0;
While N>0 do
Begin
if (N mod 10) > A then A:= N mod 10;
N:=N div 10;
End;
Write(A)
End.
Var
N,A,B:integer;
C:boolean;
Begin
Write('N = ');Read(N);
A:=-1;
B:=-2;
C:=false;
While N>0 do
Begin
if A=B then C:=true;
if N>0 then
Begin
A:=N mod 10;
N:=N div 10;
End;
if A=B then C:=true;
if N>0 then
Begin
B:=N mod 10;
N:=N div 10;
End;
End;
if A=B then C:=true;
if C then Write('Есть')
else Write('Нет')
End.
Подробнее - на -
#include <cassert>
using namespace std;
void pie_price(int a, int b, int n)
{
assert((a >= 0) && (a <= 1000));
assert((b >= 0) && (b <= 99));
assert((n >= 1) && (n <= 1000));
double price = a * 1.0 + b / 100.0;
float res = price * n;
int kop = res * 100;
cout << "Rubles " << res << endl;
cout << "Kopeyks " << kop << endl;
}
int main()
{
int a, b, n;
cin >> a >> b >> n;
pie_price(a, b, n);
}