Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include <conio.h>
- using namespace std;
- using namespace System;
- #define N 4
- int main()
- {
- float *Apesos;
- Apesos = new float[N];
- //leer
- for (int i = 0;i < N;i++)
- {
- cout << "Ingrese dato: ";cin >> Apesos[i];
- }
- //imprimir
- for (int i = 0;i < N;i++)
- cout << Apesos[i] << endl;
- cout << endl;
- //promedio pesos
- float suma = 0;
- for (int i = 0;i < N;i++)
- suma = suma + Apesos[i];
- cout << "Promedio= " << suma / N << endl;
- //Menores de 40kg
- int cont = 0;
- for (int i = 0;i < N;i++)
- if (Apesos[i] < 40)
- cont++;
- cout << "Menos de 40: " << cont << endl;
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement