Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. #include<stdbool.h>
  2. #include<stdio.h>
  3. #include<stdlib.h>
  4.  
  5. void f1()
  6. {
  7. char c;
  8. scanf ("%c", &c);
  9. int dif='a'-'A';
  10. if (c>='A'&&c<='Z')
  11. c+=dif;
  12. printf( "%c",c);
  13. }
  14. void f2()
  15. {
  16. int a,b;
  17. char Q;
  18. scanf ("%d %c %d",&a,&Q,&b);
  19. switch (Q)
  20. {
  21. case '*':printf ("%d",a*b);break;
  22. case '/':printf ("%d",a/b);break;
  23. case '+':printf ("%d",a+b);break;
  24. case '-':printf ("%d",a-b);break;
  25. case '%':printf("%d",a%b);break;
  26. default : printf (" \n");
  27. }
  28. }
  29. typedef struct
  30. {
  31. int nrleg;
  32. char nume;
  33. float nota_mate;
  34. float nota_info;
  35. float medie;
  36. float nota_bac;
  37. bool admis;
  38. bool buget;
  39.  
  40. }candidat;
  41. void citire(candidat a)
  42. {
  43. scanf ("%d",&a.nrleg);
  44. scanf ("%c",&a.nume);
  45. scanf ("%f",&a.nota_mate);
  46. scanf ("%d",&a.nota_info);
  47. scanf ("%d",&a.nota_bac);
  48. scanf ("%d",&a.nrleg);
  49. a.medie=(a.nota_info+a.nota_mate)/2;
  50.  
  51. }
  52. void qsort(void *size_t, int
  53. void medie()
  54. {
  55.  
  56.  
  57. scanf ("%f %f %f",&a.nota_mate,&a.nota_info,&a.nota_bac);
  58. float medie=(a.nota_info+a.nota_mate)/2;
  59. a.medie=medie*80/100 + a.nota_bac*20/100;
  60. printf ("%f",a.medie);
  61. }
  62. int main()
  63. {
  64. medie();
  65. return 0;
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement