标签:include srand argv 题目 \n 结果 image turn main
代码:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
int main(int argc, char **argv)
{
int a[30],b[30];
int i,c,d;
srand((unsigned int)time(NULL));
for (i = 0; i < 30; i++)
{
a[i] = rand()%101;
b[i] = rand()%101;
printf("%d......%d+%d=\n", i+1,a[i],b[i]);
}
printf("按任意键查看答案");
getchar();
for (i = 0; i < 30; i++)
{
printf("%d......%d+%d=%d\n", i+1,a[i],b[i],a[i]+b[i]);
}
getchar();
return 0;
}
结果:
标签:include srand argv 题目 \n 结果 image turn main
原文地址:https://www.cnblogs.com/qingjia/p/9752053.html