fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. class twoNum
  5. {
  6. public static void main(String args[])
  7. {
  8. Scanner sc=new Scanner(System.in);
  9. int t=sc.nextInt();
  10. while(t>0)
  11. {
  12. int p,q;
  13. int a=sc.nextInt();
  14. int b=sc.nextInt();
  15. int n=sc.nextInt();
  16. int c=n/2;
  17. int d=n-c;
  18. if(d-c==0)
  19. {
  20. if(a>b)
  21. {
  22. p=a;
  23. q=b;
  24. }
  25. else
  26. {
  27. p=b;
  28. q=a;
  29. }
  30. }
  31. else if(d-c>0)
  32. {
  33. a=a*2;
  34. if(a>b)
  35. {
  36. p=a;
  37. q=b;
  38. }
  39. else
  40. {
  41. p=b;
  42. q=a;
  43. }
  44.  
  45. }
  46. System.out.println(p/q);
  47. t--;}
  48. }
  49. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
3
1 2 1
3 2 3
3 7 2
compilation info
Main.java:46: error: variable p might not have been initialized
					System.out.println(p/q);
					                   ^
Main.java:46: error: variable q might not have been initialized
					System.out.println(p/q);
					                     ^
2 errors
stdout
Standard output is empty