Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- int main(int argc, char** argv) {
- int x[10];
- int y;
- int soma;
- int maior;
- int menor;
- float md;
- float mdn;
- y = 0;
- for(y;y<10;y++){
- cout<<"digite um numero ["<<y<<"]: ";
- cin>>x[y];
- }
- maior = x[0];
- for(y=0;y<10;y++){
- if(x[y]>maior){
- maior=x[y];
- }
- }
- menor = x[0];
- for(y=0;y<10;y++){
- if(x[y]<menor){
- menor=x[y];
- }
- }
- mdn=(maior+menor)/2;
- soma = soma + x[y];
- md = soma/10;
- cout<<"o maior numero é: "<<maior<<endl;
- cout<<"o menor numero e: "<<menor<<endl;
- cout<<"a media deles e: "<<mdn<<endl;
- cout<<"a media de todos e: "<<md<<endl;
- getch();
- return 0;
- }
Add Comment
Please, Sign In to add comment