⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex6_03.c

📁 [C语言入门经典(第4版)]整本书的源码!值得推荐!全部是最简单的源码!
💻 C
字号:
/* Exercise 6.3 A random thought for the day */
#include <stdio.h>
#include <time.h>
#include <stdlib.h>

int main(void)
{
  char thoughts[][50] = {"Wherever you go, there you are!",
                         "A nod is as good as a wink to a blind horse.",
                         "Many hands make light work.",
                         "Too many cooks spoil the broth.",
                         "A rolling stone gathers no moss.",
                         "A wise man will cover the hole in his carpet."};

  srand((unsigned int)time(NULL));

  printf("Today's thought is:\n%s\n", thoughts[rand()%(sizeof thoughts/sizeof thoughts[0])]);
  return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -