Results 1 to 5 of 5
Thread: Pascal
Hybrid View
-
24th March 2012 22:04 #1
Pascal
!
, . - , , , , .
: , , .
F(x)=0, <= 1
F(x)= 1,126x, 1< <=2
F(x)= 0,232 2<<=3
F(x) = 1,16x > 3
:
?Code:program zad_5_1; var X, Y:Real; begin Writeln ('Vyvedete X'); Readln(X); if X<=1 then begin Y:=0; Writeln ('Y=0'); end else begin if (X>1) and (X<=2) then Y:=1.126*X; Writeln ('Y=',Y:4:2); end else begin if (X>2) and (X<=3) then Y:=0.232*X; Writeln ('Y=',Y:4:2); end else begin if x>3 then Y:=1.16*X; Writeln ('Y=',Y:4:2); end; end; Readln; end.
-
24th March 2012 23:00 #2Mire-x
Join Date: Apr:2005
Location: Sofia
Posts: 763
, . , , .
(10b) || !(10b)
-
24th March 2012 23:21 #3
begin-a end; -a.
, - . , , begin ( { ), .
.
-
25th March 2012 11:54 #4! "else". ";" , , - Error in statement. , , !Code:
program zad_5_1; var X, Y:Real; begin Writeln ('Vyvedete X'); Readln(X); if X<=1 then begin Y:=0; Writeln ('Y=0'); end else begin if (X>1) and (X<=2) then Y:=1.126*X; Writeln ('Y=',Y:4:2); end else begin if (X>2) and (X<=3) then Y:=0.232*X; Writeln ('Y=',Y:4:2); end else - begin if x>3 then Y:=1.16*X; Writeln ('Y=',Y:4:2); end; end; Readln; end.
-
25th March 2012 12:57 #5




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in