Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. typedef struct{
  5. char element;
  6. float kolichestvo;
  7. int vqrno;
  8. }bokluk_t;
  9.  
  10. float pigi(bokluk_t mani[10])
  11. {
  12. float Kolichestvo=1;
  13. int sum=0;
  14. int i;
  15. for (i=0; i<10; i++)
  16. {
  17. if(mani[i].vqrno=1 && mani[i].kolichestvo<1)
  18. {
  19. Kolichestvo=Kolichestvo - mani[i].kolichestvo;
  20. if(Kolichestvo > 0)
  21. {
  22. return mani[i].element;
  23. return mani[i].kolichestvo;
  24. return mani[i].vqrno;
  25. sum=sum+mani[i].kolichestvo;
  26. }
  27. }
  28. }
  29. return sum;
  30. }
  31.  
  32. int main()
  33. {
  34. bokluk_t bobi[10];
  35. bobi[0].element='C';
  36. bobi[0].kolichestvo=0.1;
  37. bobi[0].vqrno=1;
  38. pigi(bobi);
  39. printf("%c", bobi.element);
  40. printf("%f", bobi.kolichestvo);
  41. printf("%d", bobi.vqrno);
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement