编写一个程序实现以下内容

img

#include <stdio.h>
#include <stdlib.h>
#include<time.h>
int main(){
    srand(time(0));
    int a=rand()%101+100;
    printf("%d",a); 
    return 0;
}


 觉得有用的话采纳一下哈

1.打印随机数需要两个头文件
#include <stdlib.h>
#include <time.h>
2.种随机种子(确保每次运行产生随机数不同)
srand (time(0)) ;
3.产生随机数:
产生[a,b]区间上任意整数的方法:
int x= rand( )%(b-a+1)+a