• R/O
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

練習用です。いろんなものがごちゃまぜです。


Commit MetaInfo

Revision97 (tree)
Time2015-12-27 17:42:24
Authorbellyoshi

Log Message

Change Summary

Incremental Difference

--- tanosii/chap01/chap02/Program.cs (nonexistent)
+++ tanosii/chap01/chap02/Program.cs (revision 97)
@@ -0,0 +1,52 @@
1+using System;
2+using System.Collections.Generic;
3+using System.Linq;
4+using System.Text;
5+using System.Threading.Tasks;
6+
7+namespace chap02
8+{
9+ class Program
10+ {
11+ static void Main(string[] args)
12+ {
13+ int[] stoneWeights = new int[] {7,12,5,9,17};
14+ int min = stoneWeights[0];
15+ int max = stoneWeights[0];
16+ int upper10Count = 0;
17+ bool existupper12 = false;
18+ int sum = 0;
19+ foreach(int weight in stoneWeights)
20+ {
21+ sum += weight;
22+ if(weight < min)
23+ {
24+ min = weight;
25+ }
26+ if(max < weight)
27+ {
28+ max = weight;
29+ }
30+ if (10 < weight)
31+ {
32+ upper10Count++;
33+ }
34+ if (12 < weight)
35+ {
36+ existupper12 = true;
37+ }
38+ }
39+ double avrg = sum / stoneWeights.Count();
40+
41+ Console.WriteLine($"10kg以上の石の数は{upper10Count}個です。");
42+ Console.WriteLine($"最軽量の石の重さは{min}kgです。");
43+ Console.WriteLine($"最重量の石の重さは{max}kgです。");
44+ Console.WriteLine($"平均の石の重さは{avrg}kgです。");
45+ if (existupper12) {
46+ Console.WriteLine("重さ12kgの石は含まれます。");
47+ }
48+
49+
50+ }
51+ }
52+}
--- tanosii/chap01/chap02/Properties/AssemblyInfo.cs (nonexistent)
+++ tanosii/chap01/chap02/Properties/AssemblyInfo.cs (revision 97)
@@ -0,0 +1,36 @@
1+using System.Reflection;
2+using System.Runtime.CompilerServices;
3+using System.Runtime.InteropServices;
4+
5+// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
6+// アセンブリに関連付けられている情報を変更するには、
7+// これらの属性値を変更してください。
8+[assembly: AssemblyTitle("chap02")]
9+[assembly: AssemblyDescription("")]
10+[assembly: AssemblyConfiguration("")]
11+[assembly: AssemblyCompany("")]
12+[assembly: AssemblyProduct("chap02")]
13+[assembly: AssemblyCopyright("Copyright © 2015")]
14+[assembly: AssemblyTrademark("")]
15+[assembly: AssemblyCulture("")]
16+
17+// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
18+// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
19+// その型の ComVisible 属性を true に設定してください。
20+[assembly: ComVisible(false)]
21+
22+// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります
23+[assembly: Guid("6d28b9a9-f88c-44cc-a207-a7c43b7d4dd2")]
24+
25+// アセンブリのバージョン情報は次の 4 つの値で構成されています:
26+//
27+// メジャー バージョン
28+// マイナー バージョン
29+// ビルド番号
30+// Revision
31+//
32+// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
33+// 既定値にすることができます:
34+// [assembly: AssemblyVersion("1.0.*")]
35+[assembly: AssemblyVersion("1.0.0.0")]
36+[assembly: AssemblyFileVersion("1.0.0.0")]