Deloitte | COGNIZANT | IBM | CAPGEMINI
class SolutionClass {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String s = sc.nextLine().trim();
int k= 0;
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c >= '0' && c <= '9') k += (c - '0');
}
System.out.println(s + solve(k));
}
private static int solve(int n) {
if (n <= 1) return n;
int a = 0, b = 1;
while (b < n) {
int c = a + b;
a = b;
b = c;
}
return b;
}
}
//kingdom communication✅
CAPGEMINI✅
884 ·