Diff
checker
Texte
Texte
Images
Documents
Excel
Dossiers
Legal
Enterprise
Application de bureau
Prix
Se connecter
Télécharger Diffchecker Desktop
Comparer le texte
Trouver la différence entre deux fichiers texte
Outils
Historique
Éditeur live
Masquer les espaces
Cacher identiques
Sans retour à la ligne
Vue
Divisé
Unifié
Niveau de précision
Intelligent
Mot
Caractère
Styles de texte
Modifier l’apparence
Coloration syntaxique
Choisir la syntaxe
Ignorer
Transformer le texte
Aller au premier écart
Modifier l'entrée
Diffchecker Desktop
La façon la plus sécurisée d'utiliser Diffchecker. Obtenez l'application Diffchecker Desktop : vos diffs ne quittent jamais votre ordinateur !
Obtenir Desktop
java_code
Créé
il y a 6 ans
Le diff n'expire jamais
Effacer
Exporter
Partager
Expliquer
37 suppressions
Lignes
Total
Supprimé
Caractères
Total
Supprimé
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
22 lignes
Copier tout
37 ajouts
Lignes
Total
Ajouté
Caractères
Total
Ajouté
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
23 lignes
Copier tout
Copier
Copié
Copier
Copié
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);
}
}
}
Différences enregistrées
Texte d'origine
Ouvrir un fichier
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); } }
Texte modifié
Ouvrir un fichier
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); } }
Trouver la différence