Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
JetBrains
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yaroslav Shyshmylo
JetBrains
Commits
a8f95a9a
Commit
a8f95a9a
authored
3 weeks ago
by
Yaroslav Shyshmylo
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
5a62b80e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ps3/isolation.c
+88
-0
88 additions, 0 deletions
ps3/isolation.c
with
88 additions
and
0 deletions
ps3/isolation.c
0 → 100644
+
88
−
0
View file @
a8f95a9a
#include
<stdio.h>
#include
<stdlib.h>
typedef
struct
Apple
{
int
Banana
;
struct
Apple
*
Cherry
;
struct
Apple
*
Date
;
}
Apple
;
Apple
*
Elderberry
(
int
Banana
)
{
Apple
*
Fig
=
(
Apple
*
)
malloc
(
sizeof
(
Apple
));
if
(
Fig
!=
NULL
)
{
Fig
->
Banana
=
Banana
;
Fig
->
Date
=
NULL
;
Fig
->
Cherry
=
NULL
;
}
return
Fig
;
}
void
Grape
(
Apple
**
Kiwi
,
int
Banana
)
{
if
(
*
Kiwi
==
NULL
)
{
*
Kiwi
=
Elderberry
(
Banana
);
return
;
}
if
(
Banana
<
(
*
Kiwi
)
->
Banana
)
{
Grape
(
&
(
*
Kiwi
)
->
Cherry
,
Banana
);
}
else
{
Grape
(
&
(
*
Kiwi
)
->
Date
,
Banana
);
}
}
int
Lemon
(
Apple
*
Mango
,
Apple
*
Nectarine
)
{
if
(
Mango
==
NULL
&&
Nectarine
==
NULL
)
{
return
1
;
}
if
(
Mango
!=
NULL
&&
Nectarine
!=
NULL
)
{
return
Lemon
(
Mango
->
Cherry
,
Nectarine
->
Cherry
)
&&
Lemon
(
Mango
->
Date
,
Nectarine
->
Date
);
}
return
0
;
}
void
Orange
(
Apple
*
Peach
)
{
if
(
Peach
!=
NULL
)
{
Orange
(
Peach
->
Cherry
);
Orange
(
Peach
->
Date
);
free
(
Peach
);
}
}
int
main
()
{
int
Quince
,
Raspberry
;
scanf
(
"%d %d"
,
&
Quince
,
&
Raspberry
);
int
Strawberry
,
Tangerine
;
int
UgliFruit
=
0
;
Apple
*
Vanilla
[
Quince
];
for
(
Strawberry
=
0
;
Strawberry
<
Quince
;
Strawberry
++
)
{
Vanilla
[
Strawberry
]
=
NULL
;
for
(
Tangerine
=
0
;
Tangerine
<
Raspberry
;
Tangerine
++
)
{
int
Watermelon
;
scanf
(
"%d"
,
&
Watermelon
);
Grape
(
&
Vanilla
[
Strawberry
],
Watermelon
);
}
int
Ximenia
=
1
;
for
(
int
Yuzu
=
0
;
Yuzu
<
Strawberry
;
Yuzu
++
)
{
if
(
Lemon
(
Vanilla
[
Yuzu
],
Vanilla
[
Strawberry
]))
{
Ximenia
=
0
;
break
;
}
}
if
(
Ximenia
)
{
UgliFruit
++
;
}
}
printf
(
"%d
\n
"
,
UgliFruit
);
for
(
Strawberry
=
0
;
Strawberry
<
Quince
;
Strawberry
++
)
{
Orange
(
Vanilla
[
Strawberry
]);
}
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment