Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, max=-1, min=999999999,suma=0;
- cout << "n=";
- cin >> n;
- for(int i=1 ; i<=n; ++i)
- {
- suma=suma+i;
- int x;
- cin >> x;
- if (x>=max)
- max=x;
- if (x<=min)
- min=x;
- }
- cout << "maximul este" << max << "\n" << "minimul este " << min << "\n" << "suma este" << suma;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement