diff --git a/2020/01/função_retorna.c b/2020/01/função_retorna.c index 4fdcb83..43bd518 100644 --- a/2020/01/função_retorna.c +++ b/2020/01/função_retorna.c @@ -1,4 +1,4 @@ -int funcaoBalancear () { +int funcaoRetorna () { int n; float litro1, teor1, litro1, teor2; @@ -7,12 +7,14 @@ int funcaoBalancear () { scanf("%d", &n); if(!(scanf("%f %f %f %f", &litro1, &teor1, &litro2, &teor2)) || - (litro1 || teor1 || litro2 || teor2) <= 0) return 0; + (litro1 || teor1 || litro2 || teor2) <= 0) return 0; //Se o teor for negativo ou scanf for lido incorretamente + + if((teor1 || teor2) > 1) return 1; // Se o teor for maior que 100% } int main () { - funcaoBalancear(); + funcaoRetorna(); } \ No newline at end of file