2023年12月21日发(作者:五菱宏光价格及图片)
protected void onCreate(Bundle savedInstanceState) {te(savedInstanceState);//实例化对象setContentView(ty_main);bt_0= (Button) findViewById(_0);bt_1= (Button) findViewById(_1);bt_2= (Button) findViewById(_2);bt_3= (Button) findViewById(_3);bt_4= (Button) findViewById(_4);bt_5= (Button) findViewById(_5);bt_6= (Button) findViewById(_6);bt_7= (Button) findViewById(_7);bt_8= (Button) findViewById(_8);bt_9= (Button) findViewById(_9);bt_point= (Button) findViewById(_point);bt_add= (Button) findViewById(_add);bt_subtraction= (Button) findViewById(_subtraction);bt_multiplication= (Button) findViewById(_multiplication);bt_divide= (Button) findViewById(_divide);bt_clear= (Button) findViewById(_clear);bt_equal= (Button) findViewById(_equal);tv_input= (TextView) findViewById(_input);//设置按钮的点击事件bt_lickListener(this);bt_lickListener(this);bt_lickListener(this);bt_lickListener(this);bt_lickListener(this);bt_lickListener(this);bt_lickListener(this);bt_lickListener(this);bt_lickListener(this);bt_lickListener(this);bt_lickListener(this);
bt_lickListener(this);bt_lickListener(this);bt_lickListener(this);bt_lickListener(this);bt_lickListener(this);bt_lickListener(this);}@Overridepublic void onClick(View v) {String str=tv_t().toString();switch (()){case _0:case _1:case _2:case _3:case _4:case _5:case _6:case _7:case _8:case _9:case _point:if(clear_flag){clear_flag=false;str=\"\";tv_t(\"\");}tv_t(str+((Button)v).getText());break;case _add:case _subtraction:case _multiplication:case _divide:if(clear_flag){
cnt=d1;}if((\"*\")){cnt=0;}if((\"/\")){cnt=0;}if(!ns(\".\")) {int res = (int) cnt;tv_t(res+\"\");}else {tv_t(cnt+\"\");}}//s1是空但s2不是空else if((\"\")&&!(\"\")){double d2=ouble(s2);if((\"+\")){cnt=d2;}if((\"-\")){cnt=0-d2;}if((\"*\")){cnt=0;}if((\"/\")){cnt=0;}if(!ns(\".\")) {int res = (int) cnt;tv_t(res+\"\");}else {tv_t(cnt+\"\");}
更多推荐
宏光,价格,设置,总结,对象,点击,实验
发布评论