Advertisement
M_Cracked

exercico 1060 duvida

Feb 16th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(){
  3. int a,b,c,d,e,f,g;
  4. g=0;
  5. //inserindo os numeros
  6. scanf("%d %d %d %d %d %d", &a,&b,&c,&d,&e,&f);
  7. //a questao
  8. if(a>0){
  9. g=g+1;
  10. }
  11. if(b>0){
  12. g=g++;
  13. }
  14. if(c>0){
  15. g=g++;
  16. }
  17. if(d>0){
  18. g=g++;
  19. }
  20. if(e>0){
  21. g=g++;
  22. }
  23. if(f>0){
  24. g=g++;
  25. }
  26. printf("%d valores positivos", g);
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement