Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.43 KB | None | 0 0
  1. uses crt;
  2. var tuoicon, tuoicha, dem: byte;
  3.  
  4. begin
  5.     write('Nhap tuoi cha va tuoi con: ');
  6.     readln(tuoicha, tuoicon);
  7.    
  8.     while (tuoicha - tuoicon < 25) or (tuoicha <= tuoicon * 2) do
  9.     begin
  10.         write('Nhap tuoi khong hop le! Nhap lai: ');
  11.         readln(tuoicha, tuoicon);
  12.     end;
  13.    
  14.     dem := 0;
  15.     while (tuoicon + dem) * 2 < tuoicha + dem do
  16.         dem := dem + 1;
  17.    
  18.     write('Sau ', dem,' nam thi tuoi cha bang 2 lan tuoi con');
  19.     readln;
  20. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement