Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //4
- #include <iostream>
- #include <stdlib.h>
- using namespace std;
- int comp(const void* a, const void* b)
- {
- return *(int*)a - *(int*)b;
- }
- int main(int argc, char const *argv[])
- {
- int a[] = {1, 5, -4, -2, 0, 5, 7, -4, -4}, min = a[0], cc = 0;
- for (int i = 0; i < sizeof(a)/sizeof(a[0]); i++)
- {
- if(a[i]<min){
- min = a[i];
- cc = 0;
- }
- if(a[i] == min){
- cc++;
- }
- }
- cout << cc << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement