Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- float x[5], n;
- int main()
- {
- for (int i = 0; i < 5; i++){
- cout << "wprowadz " << i+1 << " liczbe: " << endl;
- cin >>x[i];
- }
- n = x[0];
- for (int i = 1; i < 5; i++) if (n < x[i]) n = x[i];
- cout << "najwieksza liczba to: " << n << endl;
- n = x[0];
- for (int i = 1; i < 5; i++) if (n > x[i]) n = x[i];
- cout << "najmniejsza liczba to: " << n << endl;
- n = 0;
- for (int i = 0; i < 5; i++) n += x[i];
- cout << "srednia to: " << n/5 << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment