Facebook
From ShaharabiTuhin, 1 Year ago, written in C++.
Embed
Download Paste or View Raw
Hits: 70
  1. #include<stdio.h>
  2. int main(){
  3.     double a,b,c,d,t,x,y;
  4.     scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
  5.         t=(((a*2)+(b*3)+(c*4)+(d*1))/10);
  6.         printf("Media: %.1lfn", t);
  7.     if(t<5){
  8.         printf("Aluno reprovado.n");
  9.     }
  10.     if(t>=7){
  11.         printf("Aluno aprovado.n");
  12.     }
  13.     if(t>=5.0&&t<=6.9)
  14.     {
  15.         printf("Aluno em exame.n");
  16.         printf("Nota do exame: ");
  17.         scanf("%lf",&x);
  18.         y=((t+x)/2.0);
  19.             if(y>=5.0)
  20.             {
  21.                 printf("Aluno aprovado.n");
  22.                 printf("Media final: %.1lfn",y);
  23.             }
  24.             else
  25.             {
  26.                 printf("Aluno reprovado.n");
  27.             }
  28.     }
  29.     return 0;
  30. }
  31.