Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://vk.com/evgenykravchenko0
- ___ ___ ___
- / /\ ___ / /\ / /\
- / /:/_ /__/\ / /:/_ / /:/_
- / /:/ /\ \ \:\ / /:/ /\ / /:/ /\
- / /:/ /:/_ \ \:\ / /:/_/::\ / /:/ /:/_
- /__/:/ /:/ /\ ___ \__\:\ /__/:/__\/\:\ /__/:/ /:/ /\
- \ \:\/:/ /:/ /__/\ | |:| \ \:\ /~~/:/ \ \:\/:/ /:/
- \ \::/ /:/ \ \:\| |:| \ \:\ /:/ \ \::/ /:/
- \ \:\/:/ \ \:\__|:| \ \:\/:/ \ \:\/:/
- \ \::/ \__\::::/ \ \::/ \ \::/
- \__\/ ~~~~ \__\/ \__\/
- ___
- /__/\ ___ ___
- \ \:\ / /\ / /\
- \ \:\ / /:/ / /:/
- _____\__\:\ /__/::\ /__/::\
- /__/::::::::\ \__\/\:\__ \__\/\:\__
- \ \:\~~\~~\/ \ \:\/\ \ \:\/\
- \ \:\ ~~~ \__\::/ \__\::/
- \ \:\ /__/:/ /__/:/
- \ \:\ \__\/ \__\/
- \__\/
- Uses crt;
- var n, x, y, z, count: integer;
- begin
- count := 0;
- write ('Введите значение n : ');
- readln (n);
- while (n < 0) do
- begin
- clrscr;
- writeln('Введите значение n повторно');
- writeln('ПОДСКАЗКА!');
- writeln('Значение n >= 0');
- write('n : ');
- readln(n);
- end;
- for x := 0 to n do
- begin
- for y := 0 to n do
- begin
- for z := 0 to n do
- begin
- if (sqr (x) + sqr (y) + sqr (z) = n) then
- begin
- count := count + 1;
- end;
- end;
- end;
- end;
- writeln('Количество вариантов : ', count);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement