LoginSignup
0
0

More than 3 years have passed since last update.

【自分メモ】C#でランダム整数を生成しよう

Posted at

はじめに

急にC#を齧ることになり、細々と学習をしています。
文法理解がマジでできない底辺の寝言レベルのメモ。

環境

・Windows
・Microsoft Visual Studio Enterprise 2017(version 15.9.)
・.NET Framework(version 4.8.03761)

配列の宣言

test.cs
//Random
Random r = new System.Random();

//100個のint型要素が入る配列を生成。
int[] arr = new int[100];

//1~100までの整数をランダムに生成し、配列に格納する
for (int i = 0; i < arr.length; i++) 
{
     arr[i] = r.Next(0, 100);
}

まとめ

またひとつかしこくなりました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0