Results 1 to 5 of 5

Thread: Pascal

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User Barurumm's Avatar
    Join Date: Dec:2008
    Location:
    Posts: 61

    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.
    ?

  2. #2
    Mire-x
    Join Date: Apr:2005
    Location: Sofia
    Posts: 763
    , . , , .
    (10b) || !(10b)

  3. #3
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    begin-a end; -a.
    , - . , , begin ( { ), .
    .

  4. #4
    Registered User Barurumm's Avatar
    Join Date: Dec:2008
    Location:
    Posts: 61
    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.
    ! "else". ";" , , - Error in statement. , , !

  5. #5
    Banned all's Avatar
    Join Date: Feb:2003
    Location: Sofia
    Posts: 6,980
    Quote Originally Posted by Barurumm View Post
    begin
    if (X>2) and (X<=3) then
    Y:=0.232*X;
    Writeln ('Y=',Y:4:2);
    end
    else -


    if (X>2) and (X<=3) then
    begin -
    Y:=0.232*X;
    Writeln ('Y=',Y:4:2);
    end
    else

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |