Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Formato ruteo

  • Loading branch information...
commit 2d4ce4eec33919d965bdfce131f9d8a44c2af7e0 1 parent f5170fb
@rbonvall authored
View
24 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>
+
+
View
21 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);
+}
View
21 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.
Please sign in to comment.
Something went wrong with that request. Please try again.