Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  program lab5; uses crt; var s:string; n:longint; c,x,y:integer; k:char; begin clrscr; write('writen='); {$I-}repeat readln(s); {$I+} val(s,n,c); if(ioresult<>0)or(c<>0)or(n<1) then writeln('wrong type'); until(c=0)and(n>0); x:=80-length(s); y:=1; clrscr; gotoXY(28,1); write('write k/K to exit'); repeat gotoXY(x,y); write(n); delay(100); gotoXY(x,y); write(' '); x:=x-3; y:=y+1; if y>24 then begin x:=80-length(s); y:=1; end; if keypressed then k:=readkey; until(k=#75)or(k=#107)or(k='^') end.
Language: C/C++
Code:
program lab5;
uses crt;
var s:string;
n:longint;
c,x,y:integer;
k:char;
begin
clrscr;
write('writen=');
{$I-}repeat readln(s); {$I+}
val(s,n,c);
if(ioresult<>0)or(c<>0)or(n<1) then
writeln('wrong type');
until(c=0)and(n>0);
x:=80-length(s);
y:=1;
clrscr;
gotoXY(28,1);
write('write k/K to exit');
repeat
gotoXY(x,y);
write(n);
delay(100);
gotoXY(x,y);
write('    ');
x:=x-3;
y:=y+1;
if y>24 then
begin
x:=80-length(s);
y:=1;
end;
if keypressed then k:=readkey;
until(k=#75)or(k=#107)or(k='^')
end.
          
Comments: