-------------------
C / C++:
-------------------
...
int curNum = 4, sum = 0;
while (curNum <= 30)<br>{
if (curNum % 3 == 0)
sum += curNum;
++curNum;
}
printf("%i", sum);
...
----------------------
PASCAL:
----------------------
var curNum, sum : integer;
begin
curNum := 4;
sum := 0;
while (curNum <= 30) do begin<br> if curNum mod 3 = 0 then
sum := sum + curNum;
curNum := curNum + 1;
end;
writeln(sum);
end.