質問編集履歴
2
更新しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -42,9 +42,9 @@
|
|
42
42
|
|
43
43
|
double kazu;
|
44
44
|
|
45
|
-
Boolean clearflag = true;
|
45
|
+
Boolean clearflag = true;
|
46
|
-
|
46
|
+
|
47
|
-
Boolean secondflag = false;
|
47
|
+
Boolean secondflag = false;
|
48
48
|
|
49
49
|
|
50
50
|
|
@@ -280,13 +280,13 @@
|
|
280
280
|
|
281
281
|
|
282
282
|
|
283
|
-
if (clearflag == true)
|
283
|
+
if (clearflag == true)
|
284
|
-
|
284
|
+
|
285
|
-
{
|
285
|
+
{
|
286
|
-
|
286
|
+
|
287
|
-
tb_kazu.Text = "";
|
287
|
+
tb_kazu.Text = "";
|
288
|
-
|
288
|
+
|
289
|
-
clearflag = false;
|
289
|
+
clearflag = false;
|
290
290
|
|
291
291
|
}
|
292
292
|
|
@@ -430,9 +430,9 @@
|
|
430
430
|
|
431
431
|
{
|
432
432
|
|
433
|
-
tb_kazu.Text = "";
|
433
|
+
tb_kazu.Text = "";
|
434
|
-
|
434
|
+
|
435
|
-
clearflag = false;
|
435
|
+
clearflag = false;
|
436
436
|
|
437
437
|
}
|
438
438
|
|
@@ -478,7 +478,7 @@
|
|
478
478
|
|
479
479
|
tb_kazu.Text = "0";
|
480
480
|
|
481
|
-
clearflag = true;
|
481
|
+
clearflag = true;
|
482
482
|
|
483
483
|
}
|
484
484
|
|
@@ -502,9 +502,11 @@
|
|
502
502
|
|
503
503
|
|
504
504
|
|
505
|
-
if (tb_kazu.Text.IndexOf(".") < 0 )
|
505
|
+
if (tb_kazu.Text.IndexOf(".") < 0 )
|
506
|
+
|
506
|
-
|
507
|
+
{
|
508
|
+
|
507
|
-
tb_kazu.Text = tb_kazu.Text + ".";
|
509
|
+
tb_kazu.Text = tb_kazu.Text + ".";
|
508
510
|
|
509
511
|
}
|
510
512
|
|
@@ -524,9 +526,9 @@
|
|
524
526
|
|
525
527
|
//テキストボックス2に+を表示させる
|
526
528
|
|
527
|
-
first = double.Parse(tb_kazu.Text);
|
529
|
+
first = double.Parse(tb_kazu.Text);
|
528
|
-
|
530
|
+
|
529
|
-
str_mark = textBox2.Text;
|
531
|
+
str_mark = textBox2.Text;
|
530
532
|
|
531
533
|
clearflag = true; //
|
532
534
|
|
@@ -620,13 +622,13 @@
|
|
620
622
|
|
621
623
|
textBox2.Text = "=";
|
622
624
|
|
623
|
-
clearflag = true;
|
625
|
+
clearflag = true;
|
624
|
-
|
625
|
-
//10=とボタンをクリックするとクリアされていしまうのでsecondがあったらクリアするように変更する
|
626
626
|
|
627
627
|
|
628
628
|
|
629
|
+
|
630
|
+
|
629
|
-
kazu = double.Parse(tb_kazu.Text);
|
631
|
+
kazu = double.Parse(tb_kazu.Text);
|
630
632
|
|
631
633
|
// Calculation();
|
632
634
|
|
@@ -636,11 +638,9 @@
|
|
636
638
|
|
637
639
|
if(str_mark == "+") {
|
638
640
|
|
639
|
-
tb_kazu.Text = (first + kazu).ToString();
|
641
|
+
tb_kazu.Text = (first + kazu).ToString();
|
640
|
-
|
641
|
-
|
642
|
+
|
642
|
-
|
643
|
-
|
643
|
+
|
644
644
|
|
645
645
|
}
|
646
646
|
|
@@ -680,7 +680,7 @@
|
|
680
680
|
|
681
681
|
|
682
682
|
|
683
|
-
tb_kazu.Text = first.ToString();
|
683
|
+
tb_kazu.Text = first.ToString();
|
684
684
|
|
685
685
|
}
|
686
686
|
|
1
コード追加しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,4 +2,710 @@
|
|
2
2
|
|
3
3
|
10+=と入力すると答えが20になってしまします
|
4
4
|
|
5
|
-
答えが10になるようにソースコードを変更したいのですがどのように変更すればよろしいでしょうか?
|
5
|
+
答えが10になるようにソースコードを変更したいのですがどのように変更すればよろしいでしょうか?```ここに言語を入力
|
6
|
+
|
7
|
+
コード
|
8
|
+
|
9
|
+
using System;
|
10
|
+
|
11
|
+
using System.Collections.Generic;
|
12
|
+
|
13
|
+
using System.ComponentModel;
|
14
|
+
|
15
|
+
using System.Data;
|
16
|
+
|
17
|
+
using System.Drawing;
|
18
|
+
|
19
|
+
using System.Linq;
|
20
|
+
|
21
|
+
using System.Text;
|
22
|
+
|
23
|
+
using System.Threading.Tasks;
|
24
|
+
|
25
|
+
using System.Windows.Forms;
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
namespace 電卓
|
30
|
+
|
31
|
+
{
|
32
|
+
|
33
|
+
public partial class Form1 : Form
|
34
|
+
|
35
|
+
{
|
36
|
+
|
37
|
+
string str_first;
|
38
|
+
|
39
|
+
string str_mark;
|
40
|
+
|
41
|
+
double first;
|
42
|
+
|
43
|
+
double kazu;
|
44
|
+
|
45
|
+
Boolean clearflag = true; //clearflag = trueにすることによってテキストボックスの数字を空にすることができる. false
|
46
|
+
|
47
|
+
Boolean secondflag = false;//booleanはtrueかfalseで表す
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
public Form1()
|
52
|
+
|
53
|
+
{
|
54
|
+
|
55
|
+
InitializeComponent();
|
56
|
+
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
private void button6_Click(object sender, EventArgs e)
|
64
|
+
|
65
|
+
{
|
66
|
+
|
67
|
+
tb_kazu.Text = "表示";
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
}
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
private void btMpura_Click(object sender, EventArgs e)
|
76
|
+
|
77
|
+
{
|
78
|
+
|
79
|
+
tb_kazu.Text = "M+";
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
private void button8_Click(object sender, EventArgs e)
|
86
|
+
|
87
|
+
{
|
88
|
+
|
89
|
+
tb_kazu.Text = "M-";
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
private void btpacent_Click(object sender, EventArgs e)
|
96
|
+
|
97
|
+
{
|
98
|
+
|
99
|
+
tb_kazu.Text = "%+-";
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
}
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
private void button15_Click(object sender, EventArgs e)
|
108
|
+
|
109
|
+
{
|
110
|
+
|
111
|
+
tb_kazu.Text = "→";
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
}
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
private void btCIC_Click(object sender, EventArgs e)
|
120
|
+
|
121
|
+
{
|
122
|
+
|
123
|
+
tb_kazu.Text = "CI/ C";
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
}
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
private void btRMCM_Click(object sender, EventArgs e)
|
132
|
+
|
133
|
+
{
|
134
|
+
|
135
|
+
tb_kazu.Text = "RM/CM";
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
}
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
private void btoku_Click(object sender, EventArgs e)
|
144
|
+
|
145
|
+
{
|
146
|
+
|
147
|
+
tb_kazu.Text = "億";
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
}
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
private void btman_Click(object sender, EventArgs e)
|
156
|
+
|
157
|
+
{
|
158
|
+
|
159
|
+
tb_kazu.Text = "万";
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
}
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
private void btsen_Click(object sender, EventArgs e)
|
168
|
+
|
169
|
+
{
|
170
|
+
|
171
|
+
tb_kazu.Text = "千";
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
}
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
private void btpuramai_Click(object sender, EventArgs e)
|
180
|
+
|
181
|
+
{
|
182
|
+
|
183
|
+
tb_kazu.Text = "→+-←";
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
}
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
private void btzeikomi_Click(object sender, EventArgs e)
|
192
|
+
|
193
|
+
{
|
194
|
+
|
195
|
+
tb_kazu.Text = "税込";
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
}
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
private void btzeinuki_Click(object sender, EventArgs e)
|
204
|
+
|
205
|
+
{
|
206
|
+
|
207
|
+
tb_kazu.Text = "税抜";
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
}
|
212
|
+
|
213
|
+
private void bt0_Click(object sender, EventArgs e)
|
214
|
+
|
215
|
+
{
|
216
|
+
|
217
|
+
if (clearflag == true)
|
218
|
+
|
219
|
+
{
|
220
|
+
|
221
|
+
tb_kazu.Text = "";
|
222
|
+
|
223
|
+
clearflag = false;
|
224
|
+
|
225
|
+
}
|
226
|
+
|
227
|
+
tb_kazu.Text = tb_kazu.Text + "0";
|
228
|
+
|
229
|
+
}
|
230
|
+
|
231
|
+
private void bt00_Click(object sender, EventArgs e)
|
232
|
+
|
233
|
+
{
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
if (clearflag == true)
|
238
|
+
|
239
|
+
{
|
240
|
+
|
241
|
+
tb_kazu.Text = "";
|
242
|
+
|
243
|
+
clearflag = false;
|
244
|
+
|
245
|
+
}
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
if (tb_kazu.Text == "0")
|
250
|
+
|
251
|
+
{
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
}
|
256
|
+
|
257
|
+
else
|
258
|
+
|
259
|
+
{
|
260
|
+
|
261
|
+
tb_kazu.Text = tb_kazu.Text + "00";
|
262
|
+
|
263
|
+
}
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
}
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
private void button23_Click(object sender, EventArgs e)
|
276
|
+
|
277
|
+
{
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
if (clearflag == true) //clearflagがtrueだったらクリアする 500+1の際500+の次に1を押すと500がクリアされている
|
284
|
+
|
285
|
+
{
|
286
|
+
|
287
|
+
tb_kazu.Text = ""; //数を空白にする =は同じではない。代入 同じは==
|
288
|
+
|
289
|
+
clearflag = false; //clearflagをキャンセルする ←ないと永遠に初期化される。(1が増えていかない)
|
290
|
+
|
291
|
+
}
|
292
|
+
|
293
|
+
tb_kazu.Text = tb_kazu.Text + "1";
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
}
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
private void bt2_Click(object sender, EventArgs e)
|
302
|
+
|
303
|
+
{
|
304
|
+
|
305
|
+
if (clearflag == true)
|
306
|
+
|
307
|
+
{
|
308
|
+
|
309
|
+
tb_kazu.Text = "";
|
310
|
+
|
311
|
+
clearflag = false;
|
312
|
+
|
313
|
+
}
|
314
|
+
|
315
|
+
tb_kazu.Text = tb_kazu.Text + "2";
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
}
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
private void bt3_Click(object sender, EventArgs e)
|
324
|
+
|
325
|
+
{
|
326
|
+
|
327
|
+
if (clearflag == true)
|
328
|
+
|
329
|
+
{
|
330
|
+
|
331
|
+
tb_kazu.Text = "";
|
332
|
+
|
333
|
+
clearflag = false;
|
334
|
+
|
335
|
+
}
|
336
|
+
|
337
|
+
tb_kazu.Text = tb_kazu.Text + "3";
|
338
|
+
|
339
|
+
}
|
340
|
+
|
341
|
+
|
342
|
+
|
343
|
+
private void bt4_Click(object sender, EventArgs e)
|
344
|
+
|
345
|
+
{
|
346
|
+
|
347
|
+
if (clearflag == true)
|
348
|
+
|
349
|
+
{
|
350
|
+
|
351
|
+
tb_kazu.Text = "";
|
352
|
+
|
353
|
+
clearflag = false;
|
354
|
+
|
355
|
+
}
|
356
|
+
|
357
|
+
tb_kazu.Text = tb_kazu.Text + "4";
|
358
|
+
|
359
|
+
}
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
private void bt5_Click(object sender, EventArgs e)
|
364
|
+
|
365
|
+
{
|
366
|
+
|
367
|
+
if (clearflag == true)
|
368
|
+
|
369
|
+
{
|
370
|
+
|
371
|
+
tb_kazu.Text = "";
|
372
|
+
|
373
|
+
clearflag = false;
|
374
|
+
|
375
|
+
}
|
376
|
+
|
377
|
+
tb_kazu.Text = tb_kazu.Text + "5";
|
378
|
+
|
379
|
+
}
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
private void bt6_Click(object sender, EventArgs e)
|
384
|
+
|
385
|
+
{
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
if (clearflag == true)
|
390
|
+
|
391
|
+
{
|
392
|
+
|
393
|
+
tb_kazu.Text = "";
|
394
|
+
|
395
|
+
clearflag = false;
|
396
|
+
|
397
|
+
}
|
398
|
+
|
399
|
+
tb_kazu.Text = tb_kazu.Text + "6";
|
400
|
+
|
401
|
+
}
|
402
|
+
|
403
|
+
private void bt7_Click(object sender, EventArgs e)
|
404
|
+
|
405
|
+
{
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
if (clearflag == true)
|
410
|
+
|
411
|
+
{
|
412
|
+
|
413
|
+
tb_kazu.Text = "";
|
414
|
+
|
415
|
+
clearflag = false;
|
416
|
+
|
417
|
+
}
|
418
|
+
|
419
|
+
tb_kazu.Text = tb_kazu.Text + "7";
|
420
|
+
|
421
|
+
}
|
422
|
+
|
423
|
+
|
424
|
+
|
425
|
+
private void button18_Click(object sender, EventArgs e)
|
426
|
+
|
427
|
+
{
|
428
|
+
|
429
|
+
if (clearflag == true)
|
430
|
+
|
431
|
+
{
|
432
|
+
|
433
|
+
tb_kazu.Text = ""; //クリアフラグが建った時数字をクリアする(これないと0がずっと表示される)
|
434
|
+
|
435
|
+
clearflag = false; //2桁以上の数字を入力したときクリアしないように
|
436
|
+
|
437
|
+
}
|
438
|
+
|
439
|
+
tb_kazu.Text = tb_kazu.Text + "8";
|
440
|
+
|
441
|
+
}
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
|
449
|
+
private void bt9_Click(object sender, EventArgs e)
|
450
|
+
|
451
|
+
{
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
if (clearflag == true)
|
456
|
+
|
457
|
+
{
|
458
|
+
|
459
|
+
tb_kazu.Text = "";
|
460
|
+
|
461
|
+
clearflag = false;
|
462
|
+
|
463
|
+
}
|
464
|
+
|
465
|
+
tb_kazu.Text = tb_kazu.Text + "9";
|
466
|
+
|
467
|
+
}
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
private void btCA_Click(object sender, EventArgs e)
|
472
|
+
|
473
|
+
{
|
474
|
+
|
475
|
+
tb_kazu.Text = "";
|
476
|
+
|
477
|
+
textBox2.Text = "";
|
478
|
+
|
479
|
+
tb_kazu.Text = "0";
|
480
|
+
|
481
|
+
clearflag = true; //clearflagを入れることによって数字を入力した際に0がtb_kazu.textに残らない
|
482
|
+
|
483
|
+
}
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
|
488
|
+
|
489
|
+
private void btcon_Click(object sender, EventArgs e)
|
490
|
+
|
491
|
+
{
|
492
|
+
|
493
|
+
if (clearflag == true)
|
494
|
+
|
495
|
+
{
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
clearflag = false;
|
500
|
+
|
501
|
+
}
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
if (tb_kazu.Text.IndexOf(".") < 0 ) {//indexOfを入れることにより小数点が重複しないようにしている 小数点の数が0個以下なら下の処理を行う 順次処理
|
506
|
+
|
507
|
+
tb_kazu.Text = tb_kazu.Text + ".";//小数点の数が0個以下ならこの処理を行う
|
508
|
+
|
509
|
+
}
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
}
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
private void btplus_Click(object sender, EventArgs e)
|
518
|
+
|
519
|
+
{
|
520
|
+
|
521
|
+
textBox2.Text = "+";
|
522
|
+
|
523
|
+
{
|
524
|
+
|
525
|
+
//テキストボックス2に+を表示させる
|
526
|
+
|
527
|
+
first = double.Parse(tb_kazu.Text); //変数firstはテキストボックス1に表示させる
|
528
|
+
|
529
|
+
str_mark = textBox2.Text; //変数markはテキストボックス2に表示させる
|
530
|
+
|
531
|
+
clearflag = true; //
|
532
|
+
|
533
|
+
secondflag = true;
|
534
|
+
|
535
|
+
}
|
536
|
+
|
537
|
+
}
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
/// <summary>
|
542
|
+
|
543
|
+
///
|
544
|
+
|
545
|
+
/// </summary>
|
546
|
+
|
547
|
+
/// <param name="sender"></param>
|
548
|
+
|
549
|
+
/// <param name="e"></param>
|
550
|
+
|
551
|
+
private void btmainasu_Click(object sender, EventArgs e)
|
552
|
+
|
553
|
+
{
|
554
|
+
|
555
|
+
textBox2.Text = "-";
|
556
|
+
|
557
|
+
str_mark = textBox2.Text;
|
558
|
+
|
559
|
+
first = double.Parse(tb_kazu.Text);
|
560
|
+
|
561
|
+
str_mark = textBox2.Text;
|
562
|
+
|
563
|
+
clearflag = true;
|
564
|
+
|
565
|
+
secondflag = true;
|
566
|
+
|
567
|
+
}
|
568
|
+
|
569
|
+
|
570
|
+
|
571
|
+
private void btkakeru_Click(object sender, EventArgs e)
|
572
|
+
|
573
|
+
{
|
574
|
+
|
575
|
+
textBox2.Text = "×";
|
576
|
+
|
577
|
+
str_mark = textBox2.Text;
|
578
|
+
|
579
|
+
first = double.Parse(tb_kazu.Text);
|
580
|
+
|
581
|
+
str_mark = textBox2.Text;
|
582
|
+
|
583
|
+
clearflag = true;
|
584
|
+
|
585
|
+
secondflag = true;
|
586
|
+
|
587
|
+
|
588
|
+
|
589
|
+
}
|
590
|
+
|
591
|
+
private void button30_Click(object sender, EventArgs e)
|
592
|
+
|
593
|
+
{
|
594
|
+
|
595
|
+
textBox2.Text = "÷";
|
596
|
+
|
597
|
+
first = int.Parse(tb_kazu.Text);
|
598
|
+
|
599
|
+
str_mark = textBox2.Text;
|
600
|
+
|
601
|
+
clearflag = true;
|
602
|
+
|
603
|
+
secondflag = true;
|
604
|
+
|
605
|
+
}
|
606
|
+
|
607
|
+
/// <summary>
|
608
|
+
|
609
|
+
/// btwa_Click "="ボタンを押したときの処理
|
610
|
+
|
611
|
+
/// /// </summary>
|
612
|
+
|
613
|
+
/// <param name="sender"></param>
|
614
|
+
|
615
|
+
/// <param name="e"></param>
|
616
|
+
|
617
|
+
private void btwa_Click(object sender, EventArgs e)
|
618
|
+
|
619
|
+
{
|
620
|
+
|
621
|
+
textBox2.Text = "=";
|
622
|
+
|
623
|
+
clearflag = true; //=を押すとクリアされる
|
624
|
+
|
625
|
+
//10=とボタンをクリックするとクリアされていしまうのでsecondがあったらクリアするように変更する
|
626
|
+
|
627
|
+
|
628
|
+
|
629
|
+
kazu = double.Parse(tb_kazu.Text);//tb_kazu.textを小数点以下も表示できるようにしている
|
630
|
+
|
631
|
+
// Calculation();
|
632
|
+
|
633
|
+
if (secondflag == true) //secondが必要か不必要かの確認
|
634
|
+
|
635
|
+
{
|
636
|
+
|
637
|
+
if(str_mark == "+") {
|
638
|
+
|
639
|
+
tb_kazu.Text = (first + kazu).ToString();//secondがある場合の計算方法
|
640
|
+
|
641
|
+
//10+=とボタンをクリックした際に20と表示されるのでsecondに数字がなければfirstの数字のみの計算結果を表示するように変更する
|
642
|
+
|
643
|
+
//10+とボタンを押すとfirstの値が確定しkazuには10が履いていることになるので10+=と押すと計算されてしまう
|
644
|
+
|
645
|
+
}
|
646
|
+
|
647
|
+
else if (str_mark == "-")
|
648
|
+
|
649
|
+
{
|
650
|
+
|
651
|
+
tb_kazu.Text = (first - kazu).ToString();
|
652
|
+
|
653
|
+
}
|
654
|
+
|
655
|
+
else if (str_mark == "×")
|
656
|
+
|
657
|
+
{
|
658
|
+
|
659
|
+
tb_kazu.Text = (first * kazu).ToString();
|
660
|
+
|
661
|
+
}
|
662
|
+
|
663
|
+
else if (str_mark == "÷")
|
664
|
+
|
665
|
+
{
|
666
|
+
|
667
|
+
tb_kazu.Text = (first / kazu).ToString();
|
668
|
+
|
669
|
+
|
670
|
+
|
671
|
+
|
672
|
+
|
673
|
+
}
|
674
|
+
|
675
|
+
}
|
676
|
+
|
677
|
+
else
|
678
|
+
|
679
|
+
{
|
680
|
+
|
681
|
+
|
682
|
+
|
683
|
+
tb_kazu.Text = first.ToString();//secondがない場合の計算方法 tostringは文字列を数値に変換する
|
684
|
+
|
685
|
+
}
|
686
|
+
|
687
|
+
}
|
688
|
+
|
689
|
+
|
690
|
+
|
691
|
+
private void textBox2_TextChanged(object sender, EventArgs e)
|
692
|
+
|
693
|
+
{
|
694
|
+
|
695
|
+
|
696
|
+
|
697
|
+
}
|
698
|
+
|
699
|
+
private void Calculation()
|
700
|
+
|
701
|
+
{
|
702
|
+
|
703
|
+
|
704
|
+
|
705
|
+
}
|
706
|
+
|
707
|
+
}
|
708
|
+
|
709
|
+
}
|
710
|
+
|
711
|
+
```
|