Language: C

#include <stdio.h>

#define LOWER_MAX 9999999

struct NUMBER {
	int upper;
	int lower;
	int minus; // 1 = minus, 0 = plus
};

void add( struct NUMER *sum, int new_val ){
	if( new_val > 0 ){
		if( ! sum->minus ) {
			// Plus + Plus
			sum->lower = sum->lower + new_val;
			if( sum->lower > LOWER_MAX ) {
				sum->upper = sum->upper + 1;
				sum->lower = sum->lower - LOWER_MAX - 1;
			}
		} else {
			// Plus + Minus
			sum->lower = sum->lower - (-new_val);
			if( sum->lower  < 0 ){
				if( sum->upper > 0 ){
					sum->upper = sum->upper - 1;
					sum->lower = sum->lower + LOWER_MAX + 1;
				} else {
					sum->lower = sum->lower * (-1);
					sum->minus = 1;
				}
			}
		}
	} else if( new_val < 0 ) {
		if( sum->minus ){
			// Minus + Minus
			sum->lower = sum->lower + (-new_val);
			if( sum->lower > LOWER_MAX ) {
				sum->upper = sum->upper + 1;
				sum->lower = sum->lower - LOWER_MAX - 1;
			}
		} else {
			// Minus + Plus
			sum->lower = sum->lower - new_val;
			if( sum->lower  < 0 ){
				if( sum->upper > 0 ){
					sum->upper = sum->upper - 1;
					sum->lower = sum->lower + LOWER_MAX + 1;
				} else {
					sum->lower = sum->lower * (-1);
					sum->minus = 0;
				}
			}
		}
	}
}

int main(int argc, char **argv){
	int i;
	int len,val;
	int min,max;
	struct NUMBER sum;
	
	// Input Length
	scanf("%d",&len);
	
	// Input First Number
	scanf("%d",&val);
	min = val;
	max = val;
	sum.lower = 0;
	sum.upper = 0;
	sum.minus = 0;
	add(&sum,val);
	
	// Input Rest Number
	for(i=1;i<len;i++){
		scanf("%d",&val);
		if( val < min ){
			min = val;
		}
		if( val > max ){
			max = val;
		}
		add( &sum, val);
	}

	// Output
	printf("%d %d", min,max);
	if( sum.minus ){
		printf("-");
	}
	if( sum.upper > 0 ){
		printf("%d%07d\n",sum.upper,sum.lower);
	} else {
		printf("%d\n",sum.lower);
	}
	
	return 0;
}

Compiler output:
main.c:11:18: warning: 'struct NUMER' declared inside parameter list will not be visible outside of this definition or declaration
   11 | void add( struct NUMER *sum, int new_val ){
      |                  ^~~~~
main.c: In function 'add':
main.c:13:26: error: invalid use of undefined type 'struct NUMER'
   13 |                 if( ! sum->minus ) {
      |                          ^~
main.c:15:28: error: invalid use of undefined type 'struct NUMER'
   15 |                         sum->lower = sum->lower + new_val;
      |                            ^~
main.c:15:41: error: invalid use of undefined type 'struct NUMER'
   15 |                         sum->lower = sum->lower + new_val;
      |                                         ^~
main.c:16:32: error: invalid use of undefined type 'struct NUMER'
   16 |                         if( sum->lower > LOWER_MAX ) {
      |                                ^~
main.c:17:36: error: invalid use of undefined type 'struct NUMER'
   17 |                                 sum->upper = sum->upper + 1;
      |                                    ^~
main.c:17:49: error: invalid use of undefined type 'struct NUMER'
   17 |                                 sum->upper = sum->upper + 1;
      |                                                 ^~
main.c:18:36: error: invalid use of undefined type 'struct NUMER'
   18 |                                 sum->lower = sum->lower - LOWER_MAX - 1;
      |                                    ^~
main.c:18:49: error: invalid use of undefined type 'struct NUMER'
   18 |                                 sum->lower = sum->lower - LOWER_MAX - 1;
      |                                                 ^~
main.c:22:28: error: invalid use of undefined type 'struct NUMER'
   22 |                         sum->lower = sum->lower - (-new_val);
      |                            ^~
main.c:22:41: error: invalid use of undefined type 'struct NUMER'
   22 |                         sum->lower = sum->lower - (-new_val);
      |                                         ^~
main.c:23:32: error: invalid use of undefined type 'struct NUMER'
   23 |                         if( sum->lower  < 0 ){
      |                                ^~
main.c:24:40: error: invalid use of undefined type 'struct NUMER'
   24 |                                 if( sum->upper > 0 ){
      |                                        ^~
main.c:25:44: error: invalid use of undefined type 'struct NUMER'
   25 |                                         sum->upper = sum->upper - 1;
      |                                            ^~
main.c:25:57: error: invalid use of undefined type 'struct NUMER'
   25 |                                         sum->upper = sum->upper - 1;
      |                                                         ^~
main.c:26:44: error: invalid use of undefined type 'struct NUMER'
   26 |                                         sum->lower = sum->lower + LOWER_MAX + 1;
      |                                            ^~
main.c:26:57: error: invalid use of undefined type 'struct NUMER'
   26 |                                         sum->lower = sum->lower + LOWER_MAX + 1;
      |                                                         ^~
main.c:28:44: error: invalid use of undefined type 'struct NUMER'
   28 |                                         sum->lower = sum->lower * (-1);
      |                                            ^~
main.c:28:57: error: invalid use of undefined type 'struct NUMER'
   28 |                                         sum->lower = sum->lower * (-1);
      |                                                         ^~
main.c:29:44: error: invalid use of undefined type 'struct NUMER'
   29 |                                         sum->minus = 1;
      |                                            ^~
main.c:34:24: error: invalid use of undefined type 'struct NUMER'
   34 |                 if( sum->minus ){
      |                        ^~
main.c:36:28: error: invalid use of undefined type 'struct NUMER'
   36 |                         sum->lower = sum->lower + (-new_val);
      |                            ^~
main.c:36:41: error: invalid use of undefined type 'struct NUMER'
   36 |                         sum->lower = sum->lower + (-new_val);
      |                                         ^~
main.c:37:32: error: invalid use of undefined type 'struct NUMER'
   37 |                         if( sum->lower > LOWER_MAX ) {
      |                                ^~
main.c:38:36: error: invalid use of undefined type 'struct NUMER'
   38 |                                 sum->upper = sum->upper + 1;
      |                                    ^~
main.c:38:49: error: invalid use of undefined type 'struct NUMER'
   38 |                                 sum->upper = sum->upper + 1;
      |                                                 ^~
main.c:39:36: error: invalid use of undefined type 'struct NUMER'
   39 |                                 sum->lower = sum->lower - LOWER_MAX - 1;
      |                                    ^~
main.c:39:49: error: invalid use of undefined type 'struct NUMER'
   39 |                                 sum->lower = sum->lower - LOWER_MAX - 1;
      |                                                 ^~
main.c:43:28: error: invalid use of undefined type 'struct NUMER'
   43 |                         sum->lower = sum->lower - new_val;
      |                            ^~
main.c:43:41: error: invalid use of undefined type 'struct NUMER'
   43 |                         sum->lower = sum->lower - new_val;
      |                                         ^~
main.c:44:32: error: invalid use of undefined type 'struct NUMER'
   44 |                         if( sum->lower  < 0 ){
      |                                ^~
main.c:45:40: error: invalid use of undefined type 'struct NUMER'
   45 |                                 if( sum->upper > 0 ){
      |                                        ^~
main.c:46:44: error: invalid use of undefined type 'struct NUMER'
   46 |                                         sum->upper = sum->upper - 1;
      |                                            ^~
main.c:46:57: error: invalid use of undefined type 'struct NUMER'
   46 |                                         sum->upper = sum->upper - 1;
      |                                                         ^~
main.c:47:44: error: invalid use of undefined type 'struct NUMER'
   47 |                                         sum->lower = sum->lower + LOWER_MAX + 1;
      |                                            ^~
main.c:47:57: error: invalid use of undefined type 'struct NUMER'
   47 |                                         sum->lower = sum->lower + LOWER_MAX + 1;
      |                                                         ^~
main.c:49:44: error: invalid use of undefined type 'struct NUMER'
   49 |                                         sum->lower = sum->lower * (-1);
      |                                            ^~
main.c:49:57: error: invalid use of undefined type 'struct NUMER'
   49 |                                         sum->lower = sum->lower * (-1);
      |                                                         ^~
main.c:50:44: error: invalid use of undefined type 'struct NUMER'
   50 |                                         sum->minus = 0;
      |                                            ^~
main.c: In function 'main':
main.c:73:13: error: passing argument 1 of 'add' from incompatible pointer type [-Wincompatible-pointer-types]
   73 |         add(&sum,val);
      |             ^~~~
      |             |
      |             struct NUMBER *
main.c:11:25: note: expected 'struct NUMER *' but argument is of type 'struct NUMBER *'
   11 | void add( struct NUMER *sum, int new_val ){
      |           ~~~~~~~~~~~~~~^~~
main.c:84:22: error: passing argument 1 of 'add' from incompatible pointer type [-Wincompatible-pointer-types]
   84 |                 add( &sum, val);
      |                      ^~~~
      |                      |
      |                      struct NUMBER *
main.c:11:25: note: expected 'struct NUMER *' but argument is of type 'struct NUMBER *'
   11 | void add( struct NUMER *sum, int new_val ){
      |           ~~~~~~~~~~~~~~^~~