Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Avance de guia 4- Pregunta 1
#include <stdio.h> #include <ctype.h> #include <string.h> typedef struct { char numero[101]; unsigned short x; unsigned short y; }datos; unsigned short verificarNumero(datos *vector, unsigned short x, unsigned short N) { unsigned short i; for (i = 0 ; i < N ; i++) { char *digito = vector[i].numero; while ( *digito != '\0') { if ( isdigit(*digito) ) if ( ( (unsigned short)*digito >= x) ) return 0; else { if (islower(*digito)) *digito = toupper(*digito); if (!( ( (unsigned short) *digito >= 65 ) && ( (unsigned short) *digito <= 90 ) ) ) return 0; } digito ++; } } return 1; } int main(void) { unsigned short i; unsigned short N; scanf("%hu\n", &N); datos numeros[N]; for (i = 0 ; i < N ; i++) scanf("%100s %hu %hu", numeros[i].numero, &numeros[i].x, &numeros[i].y); /* for (i = 0 ; i < N ; i++) printf("%s %hu %hu\n", numeros[i].numero, numeros[i].x, numeros[i].y);*/ for (i = 0 ; i < N ; i++) if( verificarNumero(numeros[i].numero, numeros[i].x, N) == 1) break; else printf("Base incorrecta\n"); return 0; }
run
|
edit
|
history
|
help
0
C_141127_Matriz01
Student. Txt
C_141126_ArrayMayorMenor01
Factorial_LOOP
Project 4 v.3
Nearly working
poinres1
Spring 2017 Project 2 v1.2
Project 5 v.06
2.1.1 Prime numbers in different threads with thread ID