int main()
{
    int nbQuery = 0;
    int i, hi, nbInput, index=0;
    char c;
    int aff[SIZE_AFF]= {0};
    int nbaff[SIZE_NBAFF]= {0};

    scanf("%d", &nbQuery);
    for (i=0; i<nbQuery; i++)
    {
        c = getchar();
        while (c!='C' && c!='Q')
            c = getchar();

        if (c=='Q')
        {
            nbaff[index]=countAff(aff);
            index++;
        }
        else if (c=='C')
        {
            scanf("%d", &hi);
            ajouter(hi, aff);
        }
    }
    printf("\n");
    affiche2(nbaff, index);
    getchar();
    return 0;
}
Exemple #2
0
int main(void) {
	Complexe a = {1,0};
	Complexe b = {1,1};
	Complexe c = {0,1};
	Complexe d = {0,2};
	Complexe e = {2, -3};
	Complexe f = {-1, 0};
	Complexe p = {0,0};
	Complexe r = {3, -2};
	Complexe s = {-5, 1};
	affiche2(resoudre_second_degre(p, a));
	affiche2(resoudre_second_degre(r, s));
	affiche(sqrt(f));
	affiche(addition(a, c));
	affiche(multiplication(c, c));
	affiche(multiplication(b, b));
	affiche(division(d, c));
	affiche(division(e, b));
}
Exemple #3
0
void affiche2(ARBRE r)  { if (r) { printf("%s ",r->val); affiche2(r->fg); if (r->type==OPERATEUR_BINAIRE) affiche2(r->fd); }}