English
Open in Telegram
CCore Java | Java for Beginners
Core Java | Java for Beginners
@codeitupjava · group · Tech · indexed since 2026-10-08 archive for March 2022
1 312members
62writing in 30 days
3 083messages in 30 days
138 323messages in the index

Messages from March 2022

‹ March 2022 ›×
  1. K
    import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.Scanner; public class Main { private static boolean isPrime(int n) { if (n <= 1) { return false; } double sqrt = Math.sqrt(n); for (int i = 2; i <= sqrt; i++) { if (n % i == 0) { return false; } } return true; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); LocalDate start = LocalDate.parse(sc.next(), DateTimeFormatter.ofPattern("yyyyMMdd")); String day = sc.next(); int n = sc.nextInt(); sc.close(); int previousPrimeDuration = 0; for (int i = 2; ; i++) { if (isPrime(i)) { start = start.plusDays(i - previousPrimeDuration); if (isPrime(start.getMonth().ordinal() + 1) && start.getDayOfWeek().name().substring(0, 3).equals(day.toUpperCase())) { System.out.println((i <= n? "Yes ": "No ") + i); return; } previousPrimeDuration = i; } } } }
Whole thread · 1 reply →
,
Bro I need java or python code for this program
K
Ankit96Photo
import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for (int i = 0; i < t; i++) { int n = sc.nextInt(), m = sc.nextInt(); List<Set<Integer>> list = new ArrayList<>(n); loop: for (int j = 0; j < m; j++) { int a = sc.nextInt(), b = sc.nextInt(); for (Set<Integer> set: list) { if (set.contains(a)) { set.add(b); continue loop; } else if (set.contains(b)) { set.add(a); continue loop; } } Set<Integer> set = new HashSet<>(); set.add(a); set.add(b); list.add(set); } int count = 0; for (Set<Integer> set: list) { count += set.size(); } System.out.println(list.size() + n - count); } } }
K
Deleted AccountPhoto from Ramdev Kalantri
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.close(); loop: for (int i = 2, c = 0; c < n; i++) { double sqrt = Math.sqrt(i); for (int j = 2; j <= sqrt; j++) { if (i % j == 0) { continue loop; } } System.out.print(i + " "); c++; } } }
K
Padmasri ReddyPhoto
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] arr = new int[n]; for (int i = 0; i < n; i++) { arr[i] = sc.nextInt(); } sc.close(); int litres = 0; for (int i = 1; i < n-1; i++) { int leftMax = Arrays.stream(arr, 0, i).max().getAsInt(); int rightMax = Arrays.stream(arr, i+1, n).max().getAsInt(); int waterHeight = Math.min(leftMax, rightMax) - arr[i]; if (waterHeight > 0) { litres += waterHeight; } } System.out.println(litres); } }
K
Padmasri ReddyPhoto
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] arr = new int[n]; for (int i = 0; i < n; i++) { arr[i] = sc.nextInt(); } sc.close(); System.out.println(Math.round(Arrays.stream(arr).average().getAsDouble())); } }
D
LTI is hiring for below multiple cloud job profiles. if any interested, please share your details to [email protected] in below format, Also please mention your profile in the mail subject First Name: Last Name: Mail ID: JR Code: Need immediate joiners preferred within 0-30 days...!! Grab this opportunity...!!! Java Fullstack - 577007 - 3-15 Yrs C++ - 540469 - 3-10 Yrs Devops, Azure Devops, Devops Architect - 671327 - 3-9 Yrs AWS & Azure Architect (Migration and Automation) - 837287 - 9-14 Yrs Azure, .Net, Angular, Python, React JS, Java - 576929 - 3-10 Yrs AWS & Java8 Springboot / Node JS / Python / .Net Core - 887534 - 3-10 Yrs #Connections please do hit the like button,👍 comment, ✍️and share the post with your connections.📲.
M
Represent 39.23 in IEEE 754 Floating point Standard (2) (both Single and Double Precision any one can and this qn
Calendar: March 2022

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · Index limits · Remove a page · Catalog · Search · How we count