请问一下,这个程序为什么每次输出的随机数都是41+67 呢?
程序代码:
#include <stdio.h> #include <stdlib.h> #include <time.h> int main() { int a,b,c; time_t start,end; start=time(0); a=rand() % 100; b=rand() % 100; printf("%d + %d = ",a,b); scanf("%d",&c); if(c==a+b) { printf("\nyou did right"); } else { printf("\nyou did wrong"); } end=time(0); printf("\ntime: %.2f seconds.",difftime(end,start)); return 0; }