Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. const int T = 5;
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int Numbers [T] = {0, 100, 200, 300, 400};
  9.  
  10. const int *pInt = Numbers;
  11.  
  12. for (int nIndex = 0; nIndex < T; ++nIndex)
  13. cout << "Element [" << nIndex << "] = " << *(pInt + nIndex) << endl;
  14. cout << int Max(int *pInt);
  15. cout << int Min(int *pInt);
  16. getch();
  17. return 0;
  18. }
  19.  
  20. int Max(int *pInt){
  21. int maksimum=0;
  22. for (int i=0;i<10;++i)
  23. {
  24. if (*(pInt+i)>maksimum)
  25. maksimum = *(pInt+i);
  26. return maksimum;
  27. }
  28.  
  29. int Min(int *pInt)
  30. {
  31. int minimum=0;
  32. for (int i=0;i<10;++i)
  33. {
  34. if (*(pInt+i)>minimum)
  35. minimum = *(pInt+i);
  36. return minimum;
  37. }
  38. void odwracanie(int *pInt)
  39. {
  40. int tmp;
  41. int i;
  42. for(i=0; i<n/2; i++){
  43. tmp=*[pInt-i-1];
  44. *[pInt-i-1]=*pInt;
  45. *pInt=tmp;
  46. }
  47.  
  48. return;
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement