import java.util.*;
import java.lang.*;
import java.io.*;

class Main {
    public static int computeJoinPoint(int s1, int s2){
       
        while (s1!=s2){
            System.err.println("valeur de s1: " + s1);
            System.err.println("valeur de s2: " + s2);
            char [] s1ToChar = (s1 + "").toCharArray();
            char [] s2ToChar = (s2 + "").toCharArray();
           
            int i;
            for(i=0; i<s1ToChar.length;i++){
                s1 += Integer.parseInt(s1ToChar[i]+"");
            }
            for(i=0; i<s2ToChar.length;i++){
                s2 += Integer.parseInt(s2ToChar[i]+"");
            }
        }
        return s1;
    }
    public static void main(String[] args) {
        System.out.println(computeJoinPoint(471,480));
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: