Created
February 26, 2012 05:08
-
-
Save philss/1913294 to your computer and use it in GitHub Desktop.
Source code for http://br.spoj.pl/problems/SOMA/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define MAX_N 5000 | |
int main() { | |
int size = 0; | |
int tmp = 0; | |
int i = 0; | |
int soma = 0; | |
scanf("%d",&size); | |
if ( size < 1 || size > 50 ) return 0; | |
while ( i < size ) { | |
scanf("%d",&tmp); | |
if ( tmp >= -MAX_N && tmp <= MAX_N ) | |
soma += tmp; | |
i++; | |
} | |
printf("%d",soma); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment