Skip to content

Instantly share code, notes, and snippets.

@namnv609
Created December 25, 2018 00:42
Show Gist options
  • Save namnv609/c60aabbcf41fbb995a1ddc979d5a33f1 to your computer and use it in GitHub Desktop.
Save namnv609/c60aabbcf41fbb995a1ddc979d5a33f1 to your computer and use it in GitHub Desktop.
Bài toán gà chó bằng Pascal
program gaCho;
uses
crt;
var
chanGa, chanCho, soGa, soCho, i: integer;
begin
clrscr;
soCho := 0;
chanCho := 0;
chanGa := 0;
for i := 36 downto 0 do
begin
chanGa := i * 2;
chanCho := soCho * 4;
if chanGa + chanCho = 100 then
break
else
soCho := soCho + 1;
end;
writeln('So Ga: ', i, ' - So cho: ', soCho);
readln;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment