Categories

AddOn – Culori in sectiunea CODE – recunoaste instructiuni

Bine ati venit Forum General Noutati AddOn – Culori in sectiunea CODE – recunoaste instructiuni

This topic contains 0 replies, has 1 voice, and was last updated by  Fulop Huba 6 years, 6 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #917

    Fulop Huba
    Keymaster

    in cazul in care scriem o secventa de program dintr-un limbaj de programare (si includem in loc de sintaxa de prescurtare a limbajului ) acesta va fi recunoscut si colorat

    Exemplu de PHP:
    [php:138ki3dp]

    1.  
    2. < ?php
    3.       $contor = 0;     // count egal cu 0
    4.       $_xval = 5;
    5.       $_yval = 1.0;
    6.       $ceva_string = “Salut!”;
    7.       $3blindmice=3;  // Incorect !!!
    8.  ?>
    9.  

    [/php:138ki3dp]
    Exemplu de CPP:
    [cpp:138ki3dp]

    1.  
    2. #include “testare.h”
    3. #include “Cercuri.h”
    4.  
    5. #include

    6. #include
    7.  
    8. // declaratii de functii
    9. void         checkOptions(Options& opts, int argc, char* argv[]);
    10. void         createDataLine(char* buffer, HumdrumFile& infile, int line,
    11.                    double duration, int style);
    12. void         example(void);
    13. void         processRecords(HumdrumFile& infile, HumdrumFile& outfile);
    14. void         usage(const char* command);
    15.  

    [/cpp:138ki3dp]
    Exemplu de Pascal
    [PAS]
    1.program CalculateAreaOfSquare;2.{ This program calculates the area of a3. square and prints it to the console. }4.var5. length: real;6. area: real;7.begin8. //Print program header informing user of the intent of the program.9. Writeln(‘———————————-‘);10. Writeln(‘- Calculate the Area of a Square -‘);11. Writeln(‘———————————-‘);12. //Ask user to enter the length of a side of the square.13. Write(‘Please enter the length of a side of the sqaure: ‘);14. //Read the value entered by the user and store in length.15. Readln(length);16. //Calculate area and store.17. area := Sqr(length);18. //Print area to console – format area value to 10 spaces with two decimal places.19. Writeln(‘The area of the square is ‘, area:10:2);20.end.[/PAS][Code] sintaxa de prescurtare a limbajului ) acesta va fi recunoscut si colorat

    Exemplu de PHP:
    [php:138ki3dp]

    1.  
    2. < ?php
    3.       $contor = 0;     // count egal cu 0
    4.       $_xval = 5;
    5.       $_yval = 1.0;
    6.       $ceva_string = “Salut!”;
    7.       $3blindmice=3;  // Incorect !!!
    8.  ?>
    9.  

    [/php:138ki3dp]
    Exemplu de CPP:
    [cpp:138ki3dp]

    1.  
    2. #include “testare.h”
    3. #include “Cercuri.h”
    4.  
    5. #include

    6. #include
    7.  
    8. // declaratii de functii
    9. void         checkOptions(Options& opts, int argc, char* argv[]);
    10. void         createDataLine(char* buffer, HumdrumFile& infile, int line,
    11.                    double duration, int style);
    12. void         example(void);
    13. void         processRecords(HumdrumFile& infile, HumdrumFile& outfile);
    14. void         usage(const char* command);
    15.  

    [/cpp:138ki3dp]
    Exemplu de Pascal
    [PAS]
    1.program CalculateAreaOfSquare;2.{ This program calculates the area of a3. square and prints it to the console. }4.var5. length: real;6. area: real;7.begin8. //Print program header informing user of the intent of the program.9. Writeln(‘


    ‘);10. Writeln(‘- Calculate the Area of a Square -‘);11. Writeln(‘


    ‘);12. //Ask user to enter the length of a side of the square.13. Write(‘Please enter the length of a side of the sqaure: ‘);14. //Read the value entered by the user and store in length.15. Readln(length);16. //Calculate area and store.17. area := Sqr(length);18. //Print area to console – format area value to 10 spaces with two decimal places.19. Writeln(‘The area of the square is ‘, area:10:2);20.end.[/PAS]

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.