Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
AVANCE PREGUNTA 3 FICHEROS
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
#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); }
gcc
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
edit mode
|
history
|
discussion