Created
December 25, 2018 00:42
-
-
Save namnv609/c60aabbcf41fbb995a1ddc979d5a33f1 to your computer and use it in GitHub Desktop.
Bài toán gà chó bằng Pascal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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