There is String a input from user. It's a polynom. How can I derive this polinom without using array?
ınput= 3x^4+5x^45-2+77x^100
output must be 12x^3 + 225x^44 + 7700x^99
How can i know that how many x statements are there in the polynom?
my code is :
String katsayi = polinom.substring(0, polinom.indexOf("x"));
String us = polinom.substring(a + 1);
int katSayi = Integer.parseInt(katsayi);
int uS = Integer.parseInt(us);
katSayi = katSayi * uS;
uS = uS - 1;
katsayi = Integer.toString(katSayi);
us = Integer.toString(uS);
yeniPolinom = katsayi + "x^" + us;
System.out.println(yeniPolinom);