回答編集履歴

1

見直しキャンペーン中

2023/07/20 14:18

投稿

TN8001
TN8001

スコア9326

test CHANGED
@@ -1,85 +1,38 @@
1
1
  100を含むかどうかでちょっと変わります。
2
-
3
2
  `t > 100`と`t >= 100`
4
3
 
5
-
6
-
7
- ```C#
4
+ ```cs
8
-
9
5
  using System;
10
6
 
11
-
12
-
13
7
  namespace 試作品1
14
-
15
8
  {
16
-
17
9
  class Program
18
-
19
10
  {
20
-
21
11
  static void Main(string[] args)
22
-
23
12
  {
24
-
25
13
  float t = 10000;
26
-
27
14
  while(t > 100)
28
-
29
15
  {
30
-
31
16
  t = t / 2.0f;
32
-
33
17
  }
34
-
35
18
  Console.WriteLine("100以下になりました");
36
-
37
19
  Console.WriteLine(t); // 78.125
38
-
39
20
  }
40
21
 
41
- //static void Main(string[] args)
22
+ //static void Main()
42
-
43
23
  //{
44
-
45
24
  // float t = 200;
46
-
47
- // while(t > 100)
25
+ // while(t > 100) t /= 2f;
48
-
49
- // {
50
-
51
- // t = t / 2.0f;
52
-
53
- // }
54
-
55
26
  // Console.WriteLine("100以下になりました");
56
-
57
27
  // Console.WriteLine(t); // 100
58
-
59
28
  //}
60
-
61
- //static void Main(string[] args)
29
+ //static void Main()
62
-
63
30
  //{
64
-
65
31
  // float t = 200;
66
-
67
- // while(t >= 100)
32
+ // while(t >= 100) t /= 2f;
68
-
69
- // {
70
-
71
- // t = t / 2.0f;
72
-
73
- // }
74
-
75
33
  // Console.WriteLine("100未満になりました");
76
-
77
34
  // Console.WriteLine(t); // 50
78
-
79
35
  //}
80
-
81
36
  }
82
-
83
37
  }
84
-
85
38
  ```