Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SquareArea {
- public static void main(String[] args) {
- //1. страна на квадрата (цяло число) -> конзола
- //2. пресмятаме лицето на квдрата = страна * страна
- //3. принтирам лицето на квдрата
- Scanner scanner = new Scanner(System.in);
- int squareSide = Integer.parseInt(scanner.nextLine());
- int area = squareSide * squareSide;
- System.out.println(area);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment