Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4. double a,b,c,d,r,p,e,f;
  5. scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
  6. p=(a*2)+(b*3)+(c*4)+(d*1);
  7. r=p/(2+3+4+1);
  8. printf("Media: %0.1lf\n",r);
  9. if(r>=7){
  10. printf("Aluno aprovado.\n");
  11. }
  12. if(r<5){
  13. printf("Aluno reprovado.\n");
  14. }
  15. if(r>=5&&r<7){
  16. printf("Aluno em exame.\n");
  17. printf("Nota do exame: ");
  18. scanf("%lf",&e);
  19. f=(r+e)/2;
  20. if(f>=5){
  21. printf("Aluno aprovado.\n");
  22. }
  23. if(f<5){
  24. printf("Aluno reprovado.\n");
  25. }
  26. printf("Media final: %0.1lf\n",f);
  27. }
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement