View Single Post
ישן 17-05-06, 15:29   # 2
Ori
תודה על תרומתך :)
עסק רשום [?]
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
הודעות: 1,674

Ori לא מחובר  

שאלה 7 , א+ב פתרון בפסקלית:
קוד:
function bigSums(a:integer):integer;
var sum,as,ah,I,J,k:integer;
begin
	
             ah:=a mod 10;
	as:=a div 10;
	if (ah > as) then
	begin
		I:=ah;
		J:=as;
	end
	else
	begin
		I:=as;
		J:=ah;
	end;
	sum:=0;
	For K:=J to I do
		sum:=sum+K;
	bigSums:=sum;
end;


count:=0;
For I:=1 to 23 do
begin
	if (bigSums(A) > 15) then
              count:=count+1;
end;
writeln(count);
__________________
בברכה,
אורי אהרונוביץ
Admin AT uptime.co.il

  Reply With Quote