Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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);
}
}
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);
}
}
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
You can’t perform that action at this time.