From 0789cbf76ec1829cec8a53f02614aee87f2719c1 Mon Sep 17 00:00:00 2001 From: Kennedy Menezes Date: Tue, 7 Sep 2021 15:08:20 -0300 Subject: [PATCH] =?UTF-8?q?renomeando=20fun=C3=A7=C3=A3o=20e=20adicionando?= =?UTF-8?q?=20if's?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2020/01/função_retorna.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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