Bonjour à tous,

Alors voila j'ai un problème avec ce code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
 
typedef struct
{
    char *essai;
}nb;
 
int main(void)
{
    int N, i;
    nb *test;
 
    printf("Donnez le nombre de variable a tester: ");
    scanf("%d", &N);
    test = malloc(N*sizeof(nb));
    if (test == NULL)
    {
        printf("Erreur: allocation échoué");
    }
    for (i=0;i<N;i++)
    {
        printf("Entrez vos propositions: ");
        gets(test[i].essai);
    }
    for (i=0;i<N;i++)
    {
        if (test[i].essai[i] == '-' || isdigit(test[i].essai[1]) || test[i].essai[i] < 0)
        {
            printf("NO");
        }
        else
        {
            printf("YES");
        }
    }
    free(test);
    return 0;
}
Pourquoi quand je l'exécute il m'affiche deux fois d'un coup "Entrez vos propositions". Merci d'avance (ce code sert à savoir si le nom taper est valide ou non pour une variable ou une fonction)