Skip to content

Commit

Permalink
Formato ruteo
Browse files Browse the repository at this point in the history
  • Loading branch information
rbonvall committed Jun 7, 2010
1 parent f5170fb commit 2d4ce4e
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
24 changes: 24 additions & 0 deletions formato-ruteo.rst
@@ -0,0 +1,24 @@
Formato de ruteo
================

Pascal
------
.. literalinclude:: programas/ruteo-sub.pas
:linenos:

.. raw:: html

<iframe width='600' height='300' frameborder='0' src='https://spreadsheets.google.com/pub?key=0Ake0OLr39mnXdEhQa0pKU3JTdDg0RkpNZjR1djgzMmc&hl=es&single=true&gid=0&output=html&widget=true'></iframe>


C
--
.. literalinclude:: programas/ruteo-sub.c
:language: c
:linenos:

.. raw:: html

<iframe width='600' height='300' frameborder='0' src='https://spreadsheets.google.com/pub?key=0Ake0OLr39mnXdEhQa0pKU3JTdDg0RkpNZjR1djgzMmc&hl=es&single=true&gid=1&output=html&widget=true'></iframe>


21 changes: 21 additions & 0 deletions programas/ruteo-sub.c
@@ -0,0 +1,21 @@
#include <stdio.h>

int x;

int F(int a, int *b) {
int c;

a = 15;
*b = 20;
c = a + *b;
return 2 * c;
}

int main() {
int y;

x = 2;
y = 3;
x = F(2 * x, &y);
printf("x = %d, y = %d\n", x, y);
}
21 changes: 21 additions & 0 deletions programas/ruteo-sub.pas
@@ -0,0 +1,21 @@
program Ejemplo;
var
x: Integer;
y: Integer;

function F(a: Integer; var b: Integer): Integer;
var
c: Integer;
begin
a := 15;
b := 20;
c := a + b;
F := 2 * c;
end;

begin
x := 2;
y := 3;
x := F(2 * x, y);
WriteLn('x = ', x, ', y = ', y)
end.

0 comments on commit 2d4ce4e

Please sign in to comment.