From dcf8569b075554befc4bfcfc1eac3f59a4ab4d1b Mon Sep 17 00:00:00 2001 From: smallkun Date: Fri, 28 Feb 2025 09:15:39 +0800 Subject: [PATCH] Auto commit --- 2207/C语言同步练习源码/3.数组-4.c | 17 +++++++++++++++++ 2207/C语言同步练习答案.md | 20 ++++++++++++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 2207/C语言同步练习源码/3.数组-4.c diff --git a/2207/C语言同步练习源码/3.数组-4.c b/2207/C语言同步练习源码/3.数组-4.c new file mode 100644 index 0000000..e22963b --- /dev/null +++ b/2207/C语言同步练习源码/3.数组-4.c @@ -0,0 +1,17 @@ +#include +#include +#include + +int main(){ + int num[10], i; + srand((unsigned)time(NULL)); + + for(i=0;i<10;i++){ + num[i] = rand()%101; + printf("%d ", num[i]); + } + printf("\n"); + + return 0; +} + diff --git a/2207/C语言同步练习答案.md b/2207/C语言同步练习答案.md index 4bf452e..9f4eb65 100644 --- a/2207/C语言同步练习答案.md +++ b/2207/C语言同步练习答案.md @@ -540,13 +540,29 @@ int main(){ } ``` - - ### 数组-4 ![image-20250220231447834](https://yp.smallkun.cn/markdown/image-20250220231447834.png!compress) +```c +#include +#include +#include +int main(){ + int num[10], i; + srand((unsigned)time(NULL)); + + for(i=0;i<10;i++){ + num[i] = rand()%101; + printf("%d ", num[i]); + } + printf("\n"); + + return 0; +} + +``` ### 数组-5