Напишите программу поиска всех двузначных чисел, в которых есть цифра n или само число делится на n.
Answers & Comments
Sky09
Uses crt; var a,n:integer; begin write('n:'); readln(n); if n>=10 then writeln('error') else for a:=10 to 99 do if (a mod n=0) or (a div 10=n) or (a mod 10=n) then writeln(a); end.
0 votes Thanks 2
Dmon55
Dim i As Integer Dim msg As String Dim n As Integer
n = CInt(InputBox("Введите n"))
For i = 10 To 99 If CStr(i).IndexOf(n) > -1 Or i Mod n = 0 Then msg = msg & i & vbCrLf End If Next MsgBox(msg)
Answers & Comments
var a,n:integer;
begin
write('n:'); readln(n);
if n>=10 then writeln('error')
else
for a:=10 to 99 do
if (a mod n=0) or (a div 10=n) or (a mod 10=n) then writeln(a);
end.
Dim msg As String
Dim n As Integer
n = CInt(InputBox("Введите n"))
For i = 10 To 99
If CStr(i).IndexOf(n) > -1 Or i Mod n = 0 Then
msg = msg & i & vbCrLf
End If
Next
MsgBox(msg)