viernes, 8 de noviembre de 2019

Ejercicio 9

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

int cal[20], ap[20], re[20], j, h, apr, rep;
int main()
{
    for(j=0;j<=19;j++)
    {
        cout<<"ingrese calificacion"<<endl;
        cin>>cal[j];
    }

    for(h=0;h<=19;h++)
    {
        if(cal[h]>=7)
        {
           apr[ap]=cal[h];
           apr++;
        }
        if(cal[h]<7)
        {
            rep[re]=cal[h];
            rep++;
        }
    }
    cout<<"aprobados"<<endl;
    for(j=0;j<=apr;j++)
    {
        cout<<ap[j]<<endl;
    }
    cout<<"reprobados"<<endl;
    for(h=0; h<=rep;h++)
    {
        cout<<re[h]<<endl;
    }

    system("PAUSE");
    return 0;
}

No hay comentarios:

Publicar un comentario

Cadenas

#include<stdlib.h> #include<stdio.h> #include<iostream> #include<string.h> using namespace std; char nom[...