回答編集履歴
3
追記
answer
CHANGED
@@ -48,7 +48,25 @@
|
|
48
48
|
{
|
49
49
|
static void Main(string[] args)
|
50
50
|
{
|
51
|
+
for (int i = 1; i <= 100; i++)
|
52
|
+
{
|
53
|
+
if (i % 15 == 0)
|
54
|
+
{
|
51
|
-
|
55
|
+
Console.WriteLine("FizzBuzz");
|
56
|
+
}
|
57
|
+
else if (i % 5 == 0)
|
58
|
+
{
|
59
|
+
Console.WriteLine("Buzz");
|
60
|
+
}
|
61
|
+
else if (i % 3 == 0)
|
62
|
+
{
|
63
|
+
Console.WriteLine("Fizz");
|
64
|
+
}
|
65
|
+
else
|
66
|
+
{
|
67
|
+
Console.WriteLine(i);
|
68
|
+
}
|
69
|
+
}
|
52
70
|
}
|
53
71
|
}
|
54
72
|
}
|
2
追記
answer
CHANGED
@@ -26,4 +26,30 @@
|
|
26
26
|
call out.exe
|
27
27
|
|
28
28
|
|
29
|
+
```
|
30
|
+
```bat
|
31
|
+
@echo off
|
32
|
+
|
33
|
+
rem 11行目以降に C# のコードを記述してください
|
34
|
+
|
35
|
+
if exist out.cs (del out.cs)
|
36
|
+
|
37
|
+
type %~0 | more +11 >> %~dp0%out.cs
|
38
|
+
call C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe /nologo out.cs
|
39
|
+
call out.exe
|
40
|
+
|
41
|
+
exit /b
|
42
|
+
|
43
|
+
using System;
|
44
|
+
|
45
|
+
namespace Sample
|
46
|
+
{
|
47
|
+
class Program
|
48
|
+
{
|
49
|
+
static void Main(string[] args)
|
50
|
+
{
|
51
|
+
Console.WriteLine("Hello, World");
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
29
55
|
```
|
1
追記
answer
CHANGED
@@ -2,4 +2,28 @@
|
|
2
2
|
csc.exeでコンパイルするバッチファイルを作成すればよいと思います。
|
3
3
|
|
4
4
|
参考:
|
5
|
-
[Visual Studioではなく、Windows付属のcsc.exe だけでC#実行ファイルを作る](https://qiita.com/toshirot/items/dcf7809007730d835cfc)
|
5
|
+
[Visual Studioではなく、Windows付属のcsc.exe だけでC#実行ファイルを作る](https://qiita.com/toshirot/items/dcf7809007730d835cfc)
|
6
|
+
|
7
|
+
```bat
|
8
|
+
@echo off
|
9
|
+
|
10
|
+
if exist out.cs (del out.cs)
|
11
|
+
|
12
|
+
echo using System; >> out.cs
|
13
|
+
echo namespace Sample >> out.cs
|
14
|
+
echo { >> out.cs
|
15
|
+
echo class Program >> out.cs
|
16
|
+
echo { >> out.cs
|
17
|
+
echo static void Main(string[] args) >> out.cs
|
18
|
+
echo { >> out.cs
|
19
|
+
echo Console.WriteLine("Hello, World"); >> out.cs
|
20
|
+
echo } >> out.cs
|
21
|
+
echo } >> out.cs
|
22
|
+
echo } >> out.cs
|
23
|
+
|
24
|
+
call C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe /nologo out.cs
|
25
|
+
|
26
|
+
call out.exe
|
27
|
+
|
28
|
+
|
29
|
+
```
|