Startup and Tech
Sunday, 26 July 2020
Codeforces 791A Solution - Bear and Big Brother Solution In Java
Program
import java.util.*; public class x { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int cnt=0; while(!(a>b)) { a=a*3; b=b*2; cnt++; } System.out.println(cnt); } }
Output
I/p : ----- 4 7 ----- O/P : ----- 2 -----
Codeforces 116A Solution - Tram Solution In Java
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment