Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- struct staya {
- int plosht;// 60+ 90-
- int visochina;//3+ 8-
- int legala;//0
- };
- struct hotel{
- struct staya koce[100];
- int zaeti;
- };
- struct hotel leech(int broy,struct staya sex,struct hotel marina){
- if(marina.zaeti+broy<100){
- if(sex.plosht>60 && sex.plosht<90){
- if(sex.visochina>3 && sex.visochina<8){
- if(sex.legala==0){
- for(int i=marina.zaeti;i<marina.zaeti+broy;i++){
- marina.koce[i]=sex;
- }
- }
- }
- }
- }
- return marina;
- }
- int main(){
- struct staya stayam;
- struct hotel hotelm;
- int zurno=8;
- stayam.plosht=70;
- stayam.visochina=6;
- stayam.legala=0;
- hotelm.zaeti=10;
- struct hotel add=leech(zurno,stayam,hotelm);
- for (int i=hotelm.zaeti;i<hotelm.zaeti+zurno;i++){
- printf("\n %d",add.koce[i].plosht);
- }
- }
- ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement