回答編集履歴
3
追記
test
CHANGED
@@ -98,7 +98,43 @@
|
|
98
98
|
|
99
99
|
{
|
100
100
|
|
101
|
+
for (int i = 1; i <= 100; i++)
|
102
|
+
|
103
|
+
{
|
104
|
+
|
105
|
+
if (i % 15 == 0)
|
106
|
+
|
107
|
+
{
|
108
|
+
|
101
|
-
Console.WriteLine("
|
109
|
+
Console.WriteLine("FizzBuzz");
|
110
|
+
|
111
|
+
}
|
112
|
+
|
113
|
+
else if (i % 5 == 0)
|
114
|
+
|
115
|
+
{
|
116
|
+
|
117
|
+
Console.WriteLine("Buzz");
|
118
|
+
|
119
|
+
}
|
120
|
+
|
121
|
+
else if (i % 3 == 0)
|
122
|
+
|
123
|
+
{
|
124
|
+
|
125
|
+
Console.WriteLine("Fizz");
|
126
|
+
|
127
|
+
}
|
128
|
+
|
129
|
+
else
|
130
|
+
|
131
|
+
{
|
132
|
+
|
133
|
+
Console.WriteLine(i);
|
134
|
+
|
135
|
+
}
|
136
|
+
|
137
|
+
}
|
102
138
|
|
103
139
|
}
|
104
140
|
|
2
追記
test
CHANGED
@@ -55,3 +55,55 @@
|
|
55
55
|
|
56
56
|
|
57
57
|
```
|
58
|
+
|
59
|
+
```bat
|
60
|
+
|
61
|
+
@echo off
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
rem 11行目以降に C# のコードを記述してください
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
if exist out.cs (del out.cs)
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
type %~0 | more +11 >> %~dp0%out.cs
|
74
|
+
|
75
|
+
call C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe /nologo out.cs
|
76
|
+
|
77
|
+
call out.exe
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
exit /b
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
using System;
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
namespace Sample
|
90
|
+
|
91
|
+
{
|
92
|
+
|
93
|
+
class Program
|
94
|
+
|
95
|
+
{
|
96
|
+
|
97
|
+
static void Main(string[] args)
|
98
|
+
|
99
|
+
{
|
100
|
+
|
101
|
+
Console.WriteLine("Hello, World");
|
102
|
+
|
103
|
+
}
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
}
|
108
|
+
|
109
|
+
```
|
1
追記
test
CHANGED
@@ -7,3 +7,51 @@
|
|
7
7
|
参考:
|
8
8
|
|
9
9
|
[Visual Studioではなく、Windows付属のcsc.exe だけでC#実行ファイルを作る](https://qiita.com/toshirot/items/dcf7809007730d835cfc)
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
```bat
|
14
|
+
|
15
|
+
@echo off
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
if exist out.cs (del out.cs)
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
echo using System; >> out.cs
|
24
|
+
|
25
|
+
echo namespace Sample >> out.cs
|
26
|
+
|
27
|
+
echo { >> out.cs
|
28
|
+
|
29
|
+
echo class Program >> out.cs
|
30
|
+
|
31
|
+
echo { >> out.cs
|
32
|
+
|
33
|
+
echo static void Main(string[] args) >> out.cs
|
34
|
+
|
35
|
+
echo { >> out.cs
|
36
|
+
|
37
|
+
echo Console.WriteLine("Hello, World"); >> out.cs
|
38
|
+
|
39
|
+
echo } >> out.cs
|
40
|
+
|
41
|
+
echo } >> out.cs
|
42
|
+
|
43
|
+
echo } >> out.cs
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
call C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe /nologo out.cs
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
call out.exe
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
```
|