Created
June 25, 2016 21:54
-
-
Save anonymous/88223a9a7c476b3c7ce3df5e9be86eac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.gmail.druzhyninn; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
Scanner sc = new Scanner(System.in); | |
int x; | |
System.out.println("Введите 5-значное число"); | |
x = sc.nextInt(); | |
int a=x/10000; | |
int b=x%10000/1000; | |
int c=x%1000/100; | |
int d=x%100/10; | |
int e=x%10; | |
System.out.println(a); | |
System.out.println(b); | |
System.out.println(c); | |
System.out.println(d); | |
System.out.println(e); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.gmail.druzhyninn; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
Scanner sc = new Scanner(System.in); | |
int a; | |
System.out.println("Введите длинну первой стороны"); | |
a = sc.nextInt(); | |
int b; | |
System.out.println("Введите длинну второй стороны"); | |
b = sc.nextInt(); | |
int c; | |
System.out.println("Введите длинну третьей стороны"); | |
c=sc.nextInt(); | |
double p=(a+b+c)/2; | |
double x=p*(p-a)*(p-b)*(p-c); | |
double s= Math.sqrt(x); | |
System.out.println("Площадь треугольника равна "+s); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.gmail.druzhyninn; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
Scanner sc = new Scanner (System.in); | |
int r; | |
System.out.println("Введите радиус окружности"); | |
r = sc.nextInt(); | |
double s=2*Math.PI*r; | |
System.out.println("Длинна окружности равна "+ s); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment