Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3. struct staya {
  4. int plosht;// 60+ 90-
  5. int visochina;//3+ 8-
  6. int legala;//0
  7. };
  8. struct hotel{
  9. struct staya koce[100];
  10. int zaeti;
  11. };
  12.  
  13.  
  14. struct hotel leech(int broy,struct staya sex,struct hotel marina){
  15. if(marina.zaeti+broy<100){
  16. if(sex.plosht>60 && sex.plosht<90){
  17. if(sex.visochina>3 && sex.visochina<8){
  18. if(sex.legala==0){
  19. for(int i=marina.zaeti;i<marina.zaeti+broy;i++){
  20. marina.koce[i]=sex;
  21. }
  22. }
  23. }
  24. }
  25. }
  26. return marina;
  27. }
  28.  
  29. int main(){
  30. struct staya stayam;
  31. struct hotel hotelm;
  32. int zurno=8;
  33. stayam.plosht=70;
  34. stayam.visochina=6;
  35. stayam.legala=0;
  36. hotelm.zaeti=10;
  37. struct hotel add=leech(zurno,stayam,hotelm);
  38. for (int i=hotelm.zaeti;i<hotelm.zaeti+zurno;i++){
  39. printf("\n %d",add.koce[i].plosht);
  40. }
  41. }
  42.  
  43. ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement