fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int a [10];
  7. int i, max;
  8. cout<<"Введіть значення 10-ти елементів масиву \n";
  9. for(i=0; i<10; i++)
  10. {
  11. cin>>a[i];
  12. }
  13. max=a[0];
  14. for (i=0; i<10; i++)
  15. {
  16. if(a[i]>max)
  17. max=a[i];
  18. }
  19. cout<<"Масив \n";
  20. for(i=0; i<10; i++)
  21. {
  22. cout<<a[i]<<endl;
  23. }
  24. cout<<"Максимальне значення масиву дорівнює"<<max<<endl;
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0.01s 5480KB
stdin
2
7
9
6
5
9
7
8
4
8
stdout
Введіть значення 10-ти елементів масиву 
Масив 
2
7
9
6
5
9
7
8
4
8
Максимальне значення масиву дорівнює9