для твоего образца.
function cat(name, age) {
this.excuses = ['пнх', 'схб' /*здесь можно написать отмазы ленивого кота*/];
this.name = name;
this.age = age;
this.прыжков = 0;
}
cat.prototype = {
sayhello: function () { console.log("hello! my name is " + this.name); },
jump: function (height) {
if (this.прыжков > 3) console.log(this.excuses[math.random() * this.excuses.length | 0]);
else console.log(height > this.age ? "nonono i'm too young. bro! " : "jump");
this.прыжков++;
}
};
begin
write('n = ');
readln(n);
p:=2;
for i:=2 to n do
begin
f:=false;
while not f do
begin
p:=p+1;
k:=0;
for j:=2 to round(sqrt(p)) do
if p mod j = 0 then k:=k+1;
f:=k=0;
end;
end;
writeln(p);
end.
Пример:
n = 25
97