summaryrefslogtreecommitdiff
path: root/arrayMinMax.cc
diff options
context:
space:
mode:
authorSanto Cariotti <sancn@live.com>2017-04-26 16:37:39 +0200
committerSanto Cariotti <sancn@live.com>2017-04-26 16:37:39 +0200
commit483d63fa7249ad8d6020680c48c3cf6df35010b3 (patch)
tree2f8649e3ae6b42ace5011246285c9c450f004222 /arrayMinMax.cc
parent6c957dc4e01aee6ce9cae3c8342d04b0fd9ca9c4 (diff)
Moved all C++ files into CPP folder
Diffstat (limited to 'arrayMinMax.cc')
-rw-r--r--arrayMinMax.cc35
1 files changed, 0 insertions, 35 deletions
diff --git a/arrayMinMax.cc b/arrayMinMax.cc
deleted file mode 100644
index be36903..0000000
--- a/arrayMinMax.cc
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <iostream>
-
-using namespace std;
-
-int main(void)
-{
- int a[] = {5,14,9,8,10,65,32,1,6,78};
- int tot = sizeof a / sizeof(int);
- int t, i, j, minore = a[0], maggiore = a[tot-1];
-
- for(i = 0; i < tot; i++)
- {
- for(j = 0; j < tot-1; j++)
- {
- if(a[j] > a[j+1]){
- t = a[j+1];
- a[j+1] = a[j];
- a[j] = t;
- }
- }
- }
-
- //for(i = 0; i < tot; i++) cout << a[i] << endl;
-
- /*for(int i = 0; i < tot; i++)
- {
- if(a[i] < minore) minore = a[i];
- else if(a[i] > maggiore) maggiore = a[i];
- }*/
-
- cout << minore << endl;
- cout << maggiore << endl;
-
- return 0;
-}