Jump to content

Recommended Posts

Posted

program Askisi;

uses wincrt;

var arithmos, athroisma:real; erwthsh:char;

begin

      writeln("Dwse enan arithmo");

      readln(arithmos);

      writeln("Theleis na sunexiseis? An nai pata to koympi "y" an oxi pata to koympi "n"");

      readln(erwthsh);

          while erwthsh=:"y" do

                  writeln("Dwse enan arithmo");

                  readln(arithmos);

      athroisma:=athroisma+arithmos;

      writeln("Theleis na sunexiseis? An nai pata to koympi "y" an oxi pata to koympi "n"");

      readln(erwthsh);

      end; {while}

writeln("To athroisma ton arithmwn einai:", athroisma);

end.

Posted

Repeat..until καλύτερα για να κάνει πρώτα μια επανάληψη χωρίς να του κάνει ερώτηση, για να απαντήσει ναι ή όχι.

Ναι, ξέρω... απλά δεν την έχουν διδαχθεί ακόμη.

 

program Askisi;
uses wincrt;
var arithmos, athroisma:real; erwthsh:char;
begin
      athroisma:=0;
      erwthsh:="y";
while erwthsh="y"
      writeln("Dwse enan arithmo");
      readln(arithmos);
      athroisma:=athroisma+arithmos;
      writeln("Theleis na sunexiseis? An nai pata to koympi "y" an oxi pata to koympi "n"");
      readln(erwthsh);
   end;
writeln("To athroisma ton arithmwn einai:", athroisma);
end.

Έτσι πρέπει να συντάσσεται...

 

*Και αρχικοποίηση του athroisma.

Posted

Ναι, ξέρω... απλά δεν την έχουν διδαχθεί ακόμη.

 

program Askisi;
uses wincrt;
var arithmos, athroisma:real; erwthsh:char;
begin
      athroisma:=0;
      erwthsh:="y";
while erwthsh="y"
      writeln("Dwse enan arithmo");
      readln(arithmos);
      athroisma:=athroisma+arithmos;
      writeln("Theleis na sunexiseis? An nai pata to koympi "y" an oxi pata to koympi "n"");
      readln(erwthsh);
   end;
writeln("To athroisma ton arithmwn einai:", athroisma);
end.

Έτσι πρέπει να συντάσσεται...

 

*Και αρχικοποίηση του athroisma.

Ωραίος, δεν το είχα σκεφτεί έτσι!
Posted

Dn einai swsto.Exei ena error:

program Askisi;

uses wincrt;

var arithmos, athroisma:real; erwthsh:char;

begin

      athroisma:=0;

      erwthsh:="y";

while erwthsh="y"

      writeln("Dwse enan arithmo");

      readln(arithmos);

      athroisma:=athroisma+arithmos;

      writeln("Theleis na sunexiseis? An nai pata to koympi "y" an oxi pata to koympi "n"");

      readln(erwthsh);

  end;

writeln("To athroisma ton arithmwn einai:", athroisma);

end.

Posted

Δοκίμασε αυτόν τον κώδικα.

program Askisi;

uses wincrt;

var arithmos, athroisma:real; erwthsh:char;

begin

      athroisma:=0;

      erwthsh:='y';

while erwthsh='y' do

  begin

      writeln("Dwse enan arithmo");

      readln(arithmos);

      athroisma:=athroisma+arithmos;

      writeln("Theleis na sunexiseis? An nai pata to koympi "y" an oxi pata to koympi "n"");

      readln(erwthsh);

  end;

writeln("To athroisma ton arithmwn einai:", athroisma);

end.

Posted
program Askisi;

uses wincrt;

var arithmos, athroisma:real; erwthsh:char;

begin

      athroisma:=0;

      erwthsh:='y';

while erwthsh='y' do

  begin

      writeln("Dwse enan arithmo");

      readln(arithmos);

      athroisma:=athroisma+arithmos;

      writeln("Theleis na sunexiseis? An nai pata to koympi "y" an oxi pata to koympi "n"");

      readln(erwthsh);

  end;

writeln("To athroisma ton arithmwn einai:", athroisma);

end.

:p

Posted

Γενικά όπου βλέπεις 2πλα εισαγωγικά κάν'τα μονά.

Posted

ok eftasa sto telos.nmzo einai ok...Apla dn eimai sigouros gt otan pataw run m vgazei ena minima kai dn ktlbenw t leei gt einai mia glwssa xs48αδαdu43r98 kati tetio.... :/

 

Dn pirazei ftanei p eftasa ws edw...

Sas euxaristw olous gia tin voitheia :)

Posted

Γενικά όπου βλέπεις 2πλα εισαγωγικά κάν'τα μονά.

Γιατί; Εμάς δούλευε με διπλά εισαγωγικά. Μήπως στις πιο μετά εκδόσεις το άλλαξαν;
Posted

ok eftasa sto telos.nmzo einai ok...Apla dn eimai sigouros gt otan pataw run m vgazei ena minima kai dn ktlbenw t leei gt einai mia glwssa xs48αδαdu43r98 kati tetio.... :/

 

Dn pirazei ftanei p eftasa ws edw...

Sas euxaristw olous gia tin voitheia :)

Σου βγάζει μήνυμα να πατήσεις y ή n;

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock