HP NW280AAABA Bedienungsanleitung Seite 536

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 616
  • Inhaltsverzeichnis
  • FEHLERBEHEBUNG
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 535
530 Programming in HP PPL
Example 1: This program determines which integer from 2
to N has the greatest number of factors.
EXPORT MAXFACTORS(N)
BEGIN
LOCAL cur,max,k,result;
1 max;1 result;
FOR k FROM 2 TO N DO
SIZE(CAS.idivis(k)) cur;
IF cur(1) > max THEN
cur(1) max;
k result;
END;
END;
MSGBOX("Max of "+ max +" factors for
"+result);
END;
In Home, enter
MAXFACTORS(100) .
FOR STEP Syntax: FOR var FROM start TO finish [STEP increment]
DO commands END;
Sets variable var to start, and for as long as this variable
is less than or equal to finish, executes the sequence of
commands, and then adds increment to var.
Example 2: This program
draws an interesting
pattern on the screen.
EXPORT
DRAWPATTERN()
BEGIN
LOCAL
xincr,yincr,co
lor;
STARTAPP("Function");
Seitenansicht 535
1 2 ... 531 532 533 534 535 536 537 538 539 540 541 ... 615 616

Kommentare zu diesen Handbüchern

Keine Kommentare