#include<stdio.h>
#include<math.h>
#include<locale.h>
int main ( ) {
int n;
printf ( "\n Digite o tamanho da sequência: " ) ; int somaPositivo = 0 ;
int somaNegativo = 0 ;
for ( int i = 0 ; i < n; i++ ) {
printf ( "\n Digite um número da sequência: " ) ; int num;
if ( num > 0 ) somaPositivo += num;
else somaNegativo += num;
}
printf ( "\n A soma dos números positivos da sequência é: %d\n " , somaPositivo
) ; printf ( "\n A soma dos números negativos da sequência é: %d\n " , somaNegativo
) ; }
//https://pt.stackoverflow.com/q/243465/101
I2luY2x1ZGU8c3RkaW8uaD4KI2luY2x1ZGU8bWF0aC5oPgojaW5jbHVkZTxsb2NhbGUuaD4KCmludCBtYWluICgpIHsKICAgIHNldGxvY2FsZShMQ19BTEwsICJwb3J0dWd1ZXNlIik7CiAgICBpbnQgbjsKICAgIHByaW50ZigiXG4gRGlnaXRlIG8gdGFtYW5obyBkYSBzZXF1w6puY2lhOiAiKTsgCiAgICBzY2FuZigiJWQiLCAmbik7CiAgICBpbnQgc29tYVBvc2l0aXZvID0gMDsKICAgIGludCBzb21hTmVnYXRpdm8gPSAwOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICBwcmludGYoIlxuIERpZ2l0ZSB1bSBuw7ptZXJvIGRhIHNlcXXDqm5jaWE6ICIpOyAKICAgICAgICBpbnQgbnVtOwogICAgICAgIHNjYW5mKCIlZCIsICZudW0pOwogICAgICAgIGlmIChudW0gPiAwKSBzb21hUG9zaXRpdm8gKz0gbnVtOyAgCiAgICAgICAgZWxzZSBzb21hTmVnYXRpdm8gKz0gbnVtOwogICAgfSAKICAgIHByaW50ZigiXG4gQSBzb21hIGRvcyBuw7ptZXJvcyBwb3NpdGl2b3MgZGEgc2VxdcOqbmNpYSDDqTogJWRcbiIsIHNvbWFQb3NpdGl2byk7CiAgICBwcmludGYoIlxuIEEgc29tYSBkb3MgbsO6bWVyb3MgbmVnYXRpdm9zIGRhIHNlcXXDqm5jaWEgw6k6ICVkXG4iLCBzb21hTmVnYXRpdm8pOwp9CgovL2h0dHBzOi8vcHQuc3RhY2tvdmVyZmxvdy5jb20vcS8yNDM0NjUvMTAx