Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure ReadNum(var inp:longint);
- begin
- readln(inp); //read num
- end;
- procedure WriteWthSpaces(n:longint);
- var dcd:longint;
- begin
- dcd:=1; //firslty num of decs eq 1
- while n div dcd div 10>0 do //while last discharge of first dcd discharges of inputted num manre than 0 do
- dcd:=dcd*10; //add one dischatge to dcd variable
- repeat //repear cycle until dcd value eq 0
- Write(n div dcd mod 10,' '); //write last discharge of first dcd discharges of inputted num and space
- dcd:=dcd div 10; //cut last dcd discharge
- until dcd=0; // end of the cycle
- end;
- var n: LongInt;
- begin
- ReadNum(n); //read num
- WriteWthSpaces(n); // write num wth spaces
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement