Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
AVANCE PREGUNTA 3 FICHEROS
#include <string.h> typedef struct { char palabra[41]; unsigned long long frecuencia; unsigned long long longitud; }tipoPalabra; //palabras array[1000]; unsigned short verificar(char *cadena) { while ( *cadena != '\0' ) { if ( !isalpha(*cadena) ) return 0; cadena ++; } return 1; } void strUpper(char *cadena) { while ( *cadena != '\0' ) { if ( islower(*cadena) ) *cadena = toupper(*cadena); cadena ++; } } /* long long verificarPosicion(char *cadena, unsigned long long N) { unsigned long long i; for ( i = 0 ; i < N ; i ++) { if ( strcmp(cadena, str[i]) == 0) return i; } return 0; }*/ void nubeDePalabras(FILE *entrada) { char cadena[41]; //long long posicion; //tipoPalabra *palabras = NULL; unsigned long long N = 0; //unsigned long long i; while ( fscanf(entrada, "%s", cadena) != EOF ) { if ( verificar(cadena) ) { strUpper(cadena); /* palabras = (tipoPalabra *) realloc( palabras, sizeof(tipoPalabra *) * ( N + 1 ) ); if ( palabras == NULL ) exit(EXIT_FAILURE);*/ //printf("%s\n", cadena); N ++; } } printf("%llu", N); }
run
|
edit
|
history
|
help
0
lambda
Array Practice
Alphabet Triangle
WrongWay reversible iterator Copyright(C) 2016 Henry Kroll III www.thenerdshow.com
18BCE2182 ASSESS_1 Q2-3
ytre
PuntosTriangulo
Sum Two Numbers
stringify
swap_talent.c