From dde150685d5d0ea7633aeea13106c41e3b7407da Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sun, 23 Mar 2003 07:10:16 +0000 Subject: [PATCH] =?utf8?q?Import=20inicial=20despu=C3=A9s=20del=20"/var=20?= =?utf8?q?incident".=20:(?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- discreta-ej17.C | 12 ++++++++++++ discreta-ej18.C | 20 ++++++++++++++++++++ discreta-ej18a.C | 15 +++++++++++++++ discreta-ej18b.C | 15 +++++++++++++++ discreta-ej18c.C | 15 +++++++++++++++ discreta-ej18d.C | 15 +++++++++++++++ discreta-ej18e.C | 15 +++++++++++++++ 7 files changed, 107 insertions(+) create mode 100644 discreta-ej17.C create mode 100644 discreta-ej18.C create mode 100644 discreta-ej18a.C create mode 100644 discreta-ej18b.C create mode 100644 discreta-ej18c.C create mode 100644 discreta-ej18d.C create mode 100644 discreta-ej18e.C diff --git a/discreta-ej17.C b/discreta-ej17.C new file mode 100644 index 0000000..75b1b42 --- /dev/null +++ b/discreta-ej17.C @@ -0,0 +1,12 @@ +#include + +int main() { + int x = 10; + for ( int i = 1; i <= 7; i++ ) { + for ( int j = 1; j <= i + 3; j++ ) + if ( (x > 8) || ( (i > 5) && (j > 10) ) ) + printf( "%d\n", x ); + x = x - 1; + } +} + diff --git a/discreta-ej18.C b/discreta-ej18.C new file mode 100644 index 0000000..7268ae8 --- /dev/null +++ b/discreta-ej18.C @@ -0,0 +1,20 @@ +#include + +int main( int argc, char *argv[] ) { + if ( argc < 4 ) { + printf( "Formato: %s \n", *argv[0] ); + exit( 1 ); + } else + printf( "x = %s, y = %s, w = %s, t = %s\n", argv[1], argv[2], argv[3], argv[4] ); + int x, y, w, t; + int cont = 0; + do { + x = *argv[1]; + y = *argv[2]; + w = *argv[3]; + t = *argv[4]; + cont++; + } while ( ( (x != 0) && (y > 0) ) || ( !(w > 0) && (t = 3) ) ); + printf( "Veces: %d", cont ); +} + diff --git a/discreta-ej18a.C b/discreta-ej18a.C new file mode 100644 index 0000000..a4fb102 --- /dev/null +++ b/discreta-ej18a.C @@ -0,0 +1,15 @@ +#include + +int main() { + int x, y, w, t; + int cont = 0; + do { + x = 7; + y = 2; + w = 5; + t = 3; + cont++; + } while ( ( (x != 0) && (y > 0) ) || ( !(w > 0) && (t = 3) ) ); + printf( "Veces: %d", cont ); +} + diff --git a/discreta-ej18b.C b/discreta-ej18b.C new file mode 100644 index 0000000..b238f09 --- /dev/null +++ b/discreta-ej18b.C @@ -0,0 +1,15 @@ +#include + +int main() { + int x, y, w, t; + int cont = 0; + do { + x = 0; + y = 2; + w = -3; + t = 3; + cont++; + } while ( ( (x != 0) && (y > 0) ) || ( !(w > 0) && (t = 3) ) ); + printf( "Veces: %d\n", cont ); +} + diff --git a/discreta-ej18c.C b/discreta-ej18c.C new file mode 100644 index 0000000..6934c0c --- /dev/null +++ b/discreta-ej18c.C @@ -0,0 +1,15 @@ +#include + +int main() { + int x, y, w, t; + int cont = 0; + do { + x = 0; + y = -1; + w = 1; + t = 3; + cont++; + } while ( ( (x != 0) && (y > 0) ) || ( !(w > 0) && (t = 3) ) ); + printf( "Veces: %d\n", cont ); +} + diff --git a/discreta-ej18d.C b/discreta-ej18d.C new file mode 100644 index 0000000..c5ddb7d --- /dev/null +++ b/discreta-ej18d.C @@ -0,0 +1,15 @@ +#include + +int main() { + int x, y, w, t; + int cont = 0; + do { + x = 1; + y = -1; + w = 1; + t = 3; + cont++; + } while ( ( (x != 0) && (y > 0) ) || ( !(w > 0) && (t = 3) ) ); + printf( "Veces: %d\n", cont ); +} + diff --git a/discreta-ej18e.C b/discreta-ej18e.C new file mode 100644 index 0000000..1bf68c2 --- /dev/null +++ b/discreta-ej18e.C @@ -0,0 +1,15 @@ +#include + +int main() { + int x, y, w, t; + int cont = 0; + do { + x = 0; + y = 3; + w = 7; + t = 4; + cont++; + } while ( ( (x != 0) && (y > 0) ) || ( !(w > 0) && (t = 3) ) ); + printf( "Veces: %d\n", cont ); +} + -- 2.43.0