<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nandakagoodvibes</author_name>
  <author_url>https://blog.hatena.ne.jp/nandakagoodvibes/</author_url>
  <blog_title>なんだかGoodVibes</blog_title>
  <blog_url>https://nandakagoodvibes.hatenablog.com/</blog_url>
  <categories>
    <anon>C</anon>
  </categories>
  <description>こんにちは。 本日はC言語メモです。 概要 サンプルコード 概要 たまーに乱数の生成のコードを書く必要があるのですが 毎回なんだっけ？ってなるのでメモです。 使用するのは、rand()とsrand()です。 どちらもstdlib.hに含まれています。 srand()で乱数のシードを設定し、 rand()で乱数を生成します。 サンプルコード 今回は、0〜9の間で乱数を生成します。 乱数のシードには現在時刻を設定します。 #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;time.h&gt; int main() { srand((unsigned int…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnandakagoodvibes.hatenablog.com%2Fentry%2F2025%2F11%2F30%2F165929&quot; title=&quot;【C】乱数の生成 - なんだかGoodVibes&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-11-30 16:59:29</published>
  <title>【C】乱数の生成</title>
  <type>rich</type>
  <url>https://nandakagoodvibes.hatenablog.com/entry/2025/11/30/165929</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
