titi_2001

eyes

Nov 21st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. typedef struct Monitors{
  5.     char name[20];
  6.     double size;
  7.     double grade;}Monitor;
  8. int readMonitor(struct Monitors x){
  9.     printf("\n %s", x.name);
  10.     printf("\n %f, %f", x.size, x.grade);
  11. }
  12. int monitorchooser(struct Monitors x, struct Monitors y){
  13.     if(x.grade > y.grade||x.grade == y.grade){
  14.         readMonitor(x);
  15.     }
  16.     else{readMonitor(y);}
  17.     }
  18. int main()
  19. {
  20.     Monitor m;
  21.     fgets(m.name, 20, stdin);
  22.     scanf("%f", &m.size);
  23.     scanf("%f", &m.grade);
  24.     readMonitor(m);
  25. }
Add Comment
Please, Sign In to add comment