Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [pascal] pomoc w zadaniu
aleo
post
Post #1





Grupa: Zarejestrowani
Postów: 137
Pomógł: 0
Dołączył: 23.08.2008

Ostrzeżenie: (0%)
-----


Kod
program rysowanie;
uses crt; var x1,y1:longint;ss:string;
procedure pisarz(x,y:longint;s:string);
begin
gotoxy(x,y);
write(s);
end;
begin
clrscr;
   write('podaj x y i s');    read(x1);read(y1);write('podaj s');read(ss);
pisarz(x1,y1,ss);
end.


dlaczego nie wyczytuje zmiennej ss?
Go to the top of the page
+Quote Post
Kuzry
post
Post #2





Grupa: Zarejestrowani
Postów: 28
Pomógł: 4
Dołączył: 30.05.2008

Ostrzeżenie: (0%)
-----


Zamiast "read" spróbuj używać "readln" też tak mam u siebie i powinno zadziałać (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post
aleo
post
Post #3





Grupa: Zarejestrowani
Postów: 137
Pomógł: 0
Dołączył: 23.08.2008

Ostrzeżenie: (0%)
-----


Kod
program zad4;
             uses crt;
             var
             d,e,f:real;
function min3(a,b,c:real):real;
begin
if a<b then
if a<c then min3:=a
else if  b<c then min3:=b
else min3:=C;

                              end;

                              begin
                              writeln('podaj a , b  ,c ');
                              read(d);
                              read(e);
                              read(f);
                              writeln('najmniejsza wartosc',min3(d,e,f):2:0);
                              readln;



                              end.


A dlaczego tu jest źle ?
Go to the top of the page
+Quote Post
Kuzry
post
Post #4





Grupa: Zarejestrowani
Postów: 28
Pomógł: 4
Dołączył: 30.05.2008

Ostrzeżenie: (0%)
-----


Ale co konkretnie jest źle, nie wiem na czym mam się skupić ?
Go to the top of the page
+Quote Post
sebekzosw
post
Post #5





Grupa: Zarejestrowani
Postów: 437
Pomógł: 42
Dołączył: 16.04.2007

Ostrzeżenie: (0%)
-----


Mmmmm ;d Pascal (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif) I like it! ;]

wszystko jest dobrze:

Kod
program zad4;

uses crt;
var d,e,f:real;

function min3(a,b,c:real):real;
        begin
                if (a<b) AND (a<c) then min3:=a
                else if b<c then min3:=b else min3:=c;

        end;


begin
        writeln('podaj a, b, c ');
        readln(d,e,f);
        writeln('najmniejsza wartosc ',min3(d,e,f):2:0);
        readln;
end.


trochę skróciłem ;]

Ten post edytował sebekzosw 18.05.2009, 08:13:34
Go to the top of the page
+Quote Post
aleo
post
Post #6





Grupa: Zarejestrowani
Postów: 137
Pomógł: 0
Dołączył: 23.08.2008

Ostrzeżenie: (0%)
-----


kurcze ten kompilator pod arch'em dziwnie chodzi (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

U mnie się sypie :]
Go to the top of the page
+Quote Post
sebekzosw
post
Post #7





Grupa: Zarejestrowani
Postów: 437
Pomógł: 42
Dołączył: 16.04.2007

Ostrzeżenie: (0%)
-----


a konkretnie co się dzieje? ;]


Ściągnij ten:
http://www.download.net.pl/2508/Free-Pascal/

Ten post edytował sebekzosw 18.05.2009, 08:12:37
Go to the top of the page
+Quote Post
aleo
post
Post #8





Grupa: Zarejestrowani
Postów: 137
Pomógł: 0
Dołączył: 23.08.2008

Ostrzeżenie: (0%)
-----


ok dobra mam mam jeszcze jedno pytanie zadanie
zdefiniuj funkcję największy dzielnik typu longint liczby n dla liczb n -1 i 1 zwróci 1

mój kod
wydaje mi się ze dobrze działa

Kod
program nd;
  uses crt;

  var
  a:longint;

function nd1(n:longint):longint;

begin
if n>0 then nd1:=n else
if n<0 then nd1:=--1
end;

  begin
  write('podaj n');
  readln(a);
  write('nd', nd1(a):2);
  readkey;
  end.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.08.2025 - 19:47