展开全部
package sv;
import java.util.Scanner;
public class SadasTest {
public static Double gss(int n){
double a = 1;
for(int i = 1;i <=n;++i )
a = a*0.1;
return a;
}
public static void f(String s){
String str = "a" +s + "b";
int j = 0;
int x = 0;
int flag = 0;
int flag1 = 1;
double y = 0;
int gs = 1;
double[] arry = new double[100];
for(int i = 0;i
if(Character.isDigit(str.charAt(i))|| str.charAt(i) == '.'){
flag = i;
if(Character.isDigit(str.charAt(i))){
if(flag1 == 1)
x = x*10+Integer.parseInt(String.valueOf(str.charAt(i)));
else{
y = y +(Integer.parseInt(String.valueOf(str.charAt(i))))*gss(gs);
gs++;
}
}else
flag1 = 0;
}else if(flag == i-1&&i !e68a843231313335323631343130323136353331333363366132= 1/*&&(flag == 0&& i != 1)*/)
{
arry[j] = x+y;
j++;
x = 0;
y = 0;
gs = 1;
flag1 = 1;
}
}
for(int m = 0;m
int a = (int )arry[m];
if(arry[m] != a)
System.out.print(arry[m] + "\t");
else
System.out.print((int)arry[m] + "\t");
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
f(str);
}
}