Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
get the repeated max
//gcc 5.4.0 #include <stdio.h> void sort(int a[], int size) { int temp = 0; for (int i=0; i<size; i++) { for (int j=i+1; j<size;j++) { if (a[i] > a[j]) { temp = a[j]; a[j] = a[i]; a[i] = temp; } } } } int getResult(int a[], int size) { sort(a,size); int count = 0; for (int i=0; i<size; i++) { printf("a[%d] = %d\n",i,a[i]); } for (int i=0; i<size; i++) { if (a[i] == a[size -1]) { count++; } } return count; } int main(void) { int a[4] = {2,3,4,1}; int result = getResult(a,4); printf("result = %d\n",result); return 0; }
run
|
edit
|
history
|
help
0
Michael Bean's Spring 2017 Lab 3 v1
Búsqueda binaria rec
PRIMER PROGRAMA CON MALLOC()
18BCE2182 ASSESS_1 Q2-2
Test2
función malloc()
length
B_141121_aleatorios
BMI Calc CT
b=1 c=1