FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaRepository/ivanchuk/src/task4/TaskFour.java at master · karzhouAndrew/JavaRepository · GitHub
karzhouAndrew
/
JavaRepository
Public
Notifications
You must be signed in to change notification settings
Fork
16
Star
0
Code
Issues
0
Pull requests
96
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaRepository
/
ivanchuk
/
src
/
task4
/
TaskFour.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (21 loc) · 1.1 KB
Breadcrumbs
JavaRepository
/
ivanchuk
/
src
/
task4
/
TaskFour.java
Copy path
File metadata and controls
25 lines (21 loc) · 1.1 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package
task4
;
import
java
.
util
.
Scanner
;
//Имеется прямоугольное отверстие размерами a и b, определить,
//можно ли его полностью закрыть круглой картонкой радиусом r.
public
class
TaskFour
{
public
static
void
main
(
String
[]
args
) {
Scanner
in
=
new
Scanner
(
System
.
in
);
System
.
out
.
println
(
"Введите ширину и высоту прямоугольного отвестия."
);
int
width
=
in
.
nextInt
();
int
height
=
in
.
nextInt
();
System
.
out
.
println
(
"Введите радиус картонки"
);
int
radius
=
in
.
nextInt
();
in
.
close
();
double
hypotenuse
=
Math
.
sqrt
(
Math
.
pow
(
width
,
2
) +
Math
.
pow
(
height
,
2
));
if
(
2
*
radius
>
hypotenuse
) {
System
.
out
.
println
(
"Да, отверстие можно закрыть картонкой радиусом "
+
radius
);
}
else
{
System
.
out
.
println
(
"Нет, отверстие нельзя закрыть картонкой радиусом "
+
radius
);
}
}
}
Back
|
FazBrowse Home
|
New Git URL