Article View: pl.comp.lang.pascal
Article #80389prosba
From: e-e-e
Date: Tue, 21 Oct 2003 21:29
Date: Tue, 21 Oct 2003 21:29
51 lines
2383 bytes
2383 bytes
czy bylby ktos w stanie napisac ponizszy program w pascalu?
bardzo pilne - na zaliczenie :/ a ja sama nie dam rady :/
with Ada.Text_Io;
with Ada.Numerics.Elementary_Functions;
with Ada.Float_Text_Io;
use Ada.Float_Text_Io;
use Ada.Text_Io;
use Ada.Numerics.Elementary_Functions;
procedure Trojmian is
A,B,C,W,Re,Im,x : Float;
begin
Ada.Text_Io.Put ("obliczanie pierw. trzy-mianu ax^2+bx+c");New_Line;
Ada.Text_Io.Put ("Podaj wspolczynnik a:"); Get(A);
Ada.Text_Io.Put ("Podaj wspolczynnik b:"); Get(B);
Ada.Text_Io.Put ("Podaj wspolczynnik c:"); Get(C);
if(A=0.0) then
if(B=0.0 and C=0.0) then
put("Tozsame rownanie");
elsif (B=0.0 and C /=0.0) then put("Sprzeczne, bo nie mozna dzielic
przez 0");
else
put("Rownanie liniowe x="); put(-c/b);
end if;
else
W:=B*B-4.0*A*C;
Re:=B/(2.0*A); Im:=Sqrt(abs(W))/(2.0*A);
if W<0.0 then
Ada.Text_Io.Put("Pierwiastki zespolone :");New_Line;
Put("x1="); Put(-Re); Put("-i");Put(Im);Put("");
Put("x2="); Put(-Re); Put("+i");Put(Im);New_Line;
elsif W=0.0 then
Ada.Text_Io.Put("Jeden podwojny pierwiastek:");New_Line;
Put("x="); Put(-Re);
else
Ada.Text_Io.Put(" Pierwiastki rzeczywiste:");New_Line;
Put("x1="); Put(-Re-Im);Put("");
Put("x2="); Put(-Re+Im);
end if;
end if;
delay 10.1;
end Trojmian;
Technical Details
Message-ID:
<bn5dvp$ijd$1@nemesis.news.tpi.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!news.man.poznan.pl!news.task.gda.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!mat.uni.torun.pl!news.man.torun.pl!news.man.poznan.pl!news.task.gda.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: "e-e-e" <brak@wp.pl> Newsgroups: pl.comp.lang.pascal Subject: prosba Date: Tue, 21 Oct 2003 23:29:11 +0200 Organization: tp.internet - http://www.tpi.pl/ Lines: 56 Message-ID: <bn5dvp$ijd$1@nemesis.news.tpi.pl> NNTP-Posting-Host: pc62.plock.cvx.ppp.tpnet.pl X-Trace: nemesis.news.tpi.pl 1066810171 19053 217.98.236.62 (22 Oct 2003 08:09:31 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Wed, 22 Oct 2003 08:09:31 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit