Home > Mobile >  An EditText android in computing, enter 1 + 2 will be 533 then click on the plus sign will continue
An EditText android in computing, enter 1 + 2 will be 533 then click on the plus sign will continue

Time:05-27


Case R.i db jia:
Int temp=0;
For (int I=0; i Char item=number. The charAt (I);
If (item=='+');
Temp=I;
}
For (int I=0; i Char item=number. The charAt (I);
Num1=Num1 * 10 + (item);
}
For (int I=temp + 1; i Char item=number. The charAt (I);
Num2=10 + Num2 * (item);
}
If (temp==0) {
Number +="+";
Et_note2. SetText (number);
} else {
Number="";
Number +=Num1 + Num2;

}
break;

CodePudding user response:

You put your Num1, Num2, print it out and see

In addition, suggest you use the substring to do, can get what you want good Num1, Num2 than charAt for loop is convenient

CodePudding user response:

Ok, thank you thank you
  • Related