Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide whitespace changes
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Text styles
Change appearance
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
java_code
Created
6 years ago
Diff never expires
Clear
Export
Share
Explain
37 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
22 lines
Copy
37 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
23 lines
Copy
Copy
Copied
Copy
Copied
import java.util.*;
import java.util.*;
public class Main
{
public class Main
public static void main(String[] args)
{
{
Scanner sc = new Scanner(System.in);
public static void main(String[] args)
System.out.println("Input the radius of coin");
{
double rad = sc.nextDouble();
Scanner sc = new Scanner(System.in);
System.out.println("Input the thickness of coin");
System.out.println("Input the radius of coin");
double thick = sc.nextDouble();
double rad = sc.nextDouble();
System.out.println("Input the target distance of coin");
System.out.println("Input the target distance of coin");
double dist = sc.nextDouble();
double dist = sc.nextDouble();
double no_of_blocks
= 0;
double length
= 2 *
rad;
double no_of_blocks
=0.0;
double curr_length=0.0;
double length
=2*
rad;
double n=1
;
double curr_length=0.0;
while(curr_length
<
dist)
{
double n=1
.0;
no_of_blocks+
=1;
while(curr_length
<
dist)
{
curr_length = curr_length + (length*(1/(2*n)));
no_of_blocks+
+;
n+=1;
curr_length = curr_length + (length*(1/(2*n)));
}
n++;
System.out.println("Number
of blocks required are
: " +
no_of_blocks);
}
}
System.out.printf("NO
of blocks required are
%d" , (int)
no_of_blocks);
}
}
}
Saved diffs
Original text
Open file
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Input the radius of coin"); double rad = sc.nextDouble(); System.out.println("Input the thickness of coin"); double thick = sc.nextDouble(); System.out.println("Input the target distance of coin"); double dist = sc.nextDouble(); double no_of_blocks = 0; double length = 2 * rad; double curr_length=0.0; double n=1; while(curr_length < dist) { no_of_blocks+=1; curr_length = curr_length + (length*(1/(2*n))); n+=1; } System.out.println("Number of blocks required are: " + no_of_blocks); } }
Changed text
Open file
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Input the radius of coin"); double rad = sc.nextDouble(); System.out.println("Input the target distance of coin"); double dist = sc.nextDouble(); double no_of_blocks=0.0; double length=2*rad; double curr_length=0.0; double n=1.0; while(curr_length<dist){ no_of_blocks++; curr_length = curr_length + (length*(1/(2*n))); n++; } System.out.printf("NO of blocks required are %d" , (int)no_of_blocks); } }
Find difference