From: Leandro Lucarella Date: Sun, 23 Mar 2003 07:10:16 +0000 (+0000) Subject: Import inicial después del "/var incident". :( X-Git-Tag: svn_import~1 X-Git-Url: https://git.llucax.com/z.facultad/61.07/ejercicios.git/commitdiff_plain/dde150685d5d0ea7633aeea13106c41e3b7407da Import inicial después del "/var incident". :( --- dde150685d5d0ea7633aeea13106c41e3b7407da 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 ); +} +