This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
double factorial(int); | |
int main(){ | |
int numero = 5; | |
double total; | |
total = factorial(numero); | |
printf("El factorial de %d es %d\n", numero, total); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
/* Prototipo de la función */ | |
double potencia(int, int); | |
int main(){ | |
// Declaramos las variables | |
int bas = 2; | |
int expo = 3; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(){ | |
// Variable de archivo | |
FILE *datos = NULL; | |
// Abrimos el archivo | |
datos = fopen("/home/nomar/datos", "a"); | |
// Comprobamos que de verdad abrio | |
if(manejador_archivo == NULL ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(){ | |
// La variable de archivo | |
FILE *archivito; | |
// Variable para escribir datos en el archivo | |
char buffer[100] = "Hola Mundo"; | |
// Variable numerica | |
float numero = 3.1416; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Suponga que el contenido del archivo es: | |
* Gol | |
* Hola mundo | |
* Esto es un numero con formato 3.141 | |
* 3.141 | |
* | |
* Con esto en mente, empecemos. | |
*/ | |
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
// Esta estructura se declara global para que todas las funciones del programa | |
// tengan acceso a su definición. | |
struct formulario { | |
char nombres[200]; | |
char apellidos[200]; | |
short edad; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
// Esta estructura se declara global para que todas las funciones del programa | |
// tengan acceso a su definición. | |
struct formulario { | |
char nombres[200]; | |
char apellidos[200]; | |
short edad; | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for archivo in `grep -rl -E "\/\*[0-9A-Za-z]{32}\*\/" *`; do | |
cp $archivo $archivo.bak; # this is just in case | |
chmod 440 $archivo.bak; # juuuuust in case | |
sed -ie 's/\(\/\*[0-9A-Za-z]\{32\}\*\/\).*\1//' $archivo; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for archivo in `find ./ -type f | grep php`; do | |
echo ------- $archivo -------; | |
cat $archivo | sed 's/ /\n/g' | sort | uniq | awk '{print length, $0}' | sort -nr | head; | |
echo ------- $archivo -------; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for archivo in `find ./ -type f | grep php`; do | |
echo; echo ------- $archivo -------; | |
awk 'length > max_length { max_length = length; longest_line = $0 } END { print longest_line }' $archivo; | |
echo ------- $archivo -------; echo; | |
done |
OlderNewer