Advertisement
Guest User

lipjih

a guest
Feb 27th, 2015
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <stdio.h>
  4. typedef struct{
  5. int freq;
  6. int ram;
  7. int hd;
  8. char processor[256];
  9. }
  10. computer;
  11. computer c[3];
  12. int main(){
  13. c[0].ram = 8;
  14. c[0].hd = 500;
  15. c[0].freq = 3;
  16.  
  17. c[1].ram = 4;
  18. c[1].hd = 500;
  19. c[1].freq = 3;
  20.  
  21. c[2].ram = 2;
  22. c[2].hd = 1000;
  23. c[2].freq = 9;
  24.  
  25. int aux=0;
  26. for(int i=0;i<3;i++)
  27. if (c[i].freq>aux)
  28. aux=c[i].freq;
  29.  
  30. printf("%i\n",aux);
  31.  
  32. for(int i=0;i<3;i++)
  33. if (c[i].freq==aux)
  34. printf("calc no %d este server ", i);
  35.  
  36. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement