Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses
- crt;
- function MyFunction(txt:string): longint;
- begin
- Write(txt+#32);
- var temp: string;
- var ch: char;
- repeat
- ch := ReadKey;
- if ch in [#48..#57] then
- begin
- Write(ch);
- temp += ch;
- end
- else if ch <> #13 then System.Console.Beep(800, 500);
- until ch = #13;
- WriteLn;
- Result := StrToInt(temp);
- end;
- begin
- var x := MyFunction('Введите первое число:');
- var y := MyFunction('Введите второе число:');
- WriteLn('Результат: ', x, ' ', y);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement