متوازی الاضلاع
يكشنبه, ۱۱ آبان ۱۳۹۹، ۰۳:۳۵ ب.ظ
import java.util.Scanner; public class Parallelogram { private static boolean flag=false; private static int breadth , height; static Scanner scanner = new Scanner(System.in); static{ breadth=scanner.nextInt(); height=scanner.nextInt(); if(breadth<=0 || height<=0) flag=false; else flag=true; System.out.println(flag? "valid":"invalid"); } public static void main(String[] args) { //don't change main body if (flag) { int area = breadth * height; System.out.print(area); } } }
۹۹/۰۸/۱۱