c语言程序分析问题

来源:百度知道 编辑:UC知道 时间:2024/06/28 00:33:39
请高手分析一下这个程序,要尽量的详细!!#include "time.h"
#include "stdlib.h"
#include "stdio.h"
main()
ächar c;
clock§t start,end;
time§t a,b;
double var;
int i,guess;
srand(time(NULL));
printf("do you want to play it.('y' or 'n') Ön");
loop:
while((c=getchar())=='y')
ä
i=rand()%100;
printf("Önplease input number you guess:Ön");
start=clock();
a=time(NULL);
scanf("%d",&guess);
while(guess!=i)
äif(guess>i)
äprintf("please input a little smaller.Ön");
scanf("%d",&guess);ñ
else
äprintf("please input a little bigger.Ön");
scanf("%d",&guess);ñ
ñ
end=clock();
b=time(NULL);
printf("Ö1: It took you %6.3f secondsÖn",var=(double)(end-start)/18.2);
printf(&quo

Ö是什么。。好壮观~~

喔,挺多乱码的嘛~~

#include "stdlib.h"
#include "stdio.h"
main()
?char c;
clock§t start,end;
time§t a,b;
double var;
int i,guess;
srand(time(NULL));
printf("do you want to play it.('y' or 'n') ?n");
loop:
while((c=getchar())=='y')
?
i=rand()%100;
printf("?nplease input number you guess:?n");
start=clock();
a=time(NULL);
scanf("%d",&guess);
while(guess!=i)
?if(guess>i)
?printf("please input a little smaller.?n");
scanf("%d",&guess);?
else
?printf("please input a little bigger.?n");
scanf("%d",&guess);?
?
end=clock();
b=time(NULL);
printf("?1: It took you %6.3f seconds?n",var=(double)(end-start)/18.2);
printf("?1: it took you %6.3f seconds?n?n",difftime(b,a))