Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
BigInteger maxMinSum
//gcc 5.4.0 #include <stdio.h> #include <stdint.h> #include <inttypes.h> void sort(int64_t 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; } } } } void arraySum(int64_t a[], int size) { sort(a,size); int sum =0; for (int i=0; i<size; i++) { printf("a[%d] = %d\n",i,a[i]); } for (int i=0; i< size-1; i++) { sum = sum + a[i]; } printf("%" PRId64,sum); printf(" "); sum =0; for (int i=1; i< size; i++) { sum = sum + a[i]; } printf("%" PRId64,sum); } int main(void) { int64_t a[5] = {256741038,623958417,467905213,714532089,938071625}; arraySum(a,5); return 0; }
run
|
edit
|
history
|
help
0
función malloc()
hwk2
Day Of The Programmer
DUE BY TUESDAY
CS HW2
PER problem 2
Polidivisible
Pointer
example
C141105_SwitchNotas