关于一道有命令不执行的问题
#include"stdio.h"#include"stdlib.h"
int main()
{
int h,m,s,speed,a,h1,m1,s1;
double v,v1;
char c;
printf("first time:");
scanf("%d:%d:%d",&h,&m,&s);
printf("input speed:");
getchar();
scanf("&d",&v);
sudugaibian:
v1=v;
while(v1==v){
printf("another time:");
getchar();
scanf("%d:%d:%d:",&h1,&m1,&s1);
printf("shifoubiansu?");
scanf("%d",&a);
if(a){
printf("new speed:");
getchar();
scanf("%d",&v1);
break;
}
else;
}
{
int t;double L; /*L表示路程,t表示时间,秒为单位*/
t=(3600*h1+60*m1+s1)-(3600*h+60*m+s);
v=(v1+v)/2;
v=v*(5.0/18);
L=(v*t)/1000;
printf("weiyi:%.2fkm",L);
}
v=v*3.6;
printf("\nif enter #,stop:\nelse continue:");
getchar();
c=getchar();
if(c=='#')
exit(0);
else ;
goto sudugaibian;
return 0;
}[local]1[/local]请问为什么scanf("%d:%d:%d",&h1,&m1,&s1)这条语句没执行呢?#include"stdio.h"
#include"stdlib.h"
int main()
{
int h,m,s,speed,a,h1,m1,s1;
double v,v1;
char c;
printf("first time:");
scanf("%d:%d:%d",&h,&m,&s);
printf("input speed:");
getchar();
scanf("&d",&v);
sudugaibian:
v1=v;
while(v1==v){
printf("another time:");
getchar();
scanf("%d:%d:%d:",&h1,&m1,&s1);
printf("shifoubiansu?");
scanf("%d",&a);
if(a){
printf("new speed:");
getchar();
scanf("%d",&v1);
break;
}
else;
}
{
int t;double L; /*L表示路程,t表示时间,秒为单位*/
t=(3600*h1+60*m1+s1)-(3600*h+60*m+s);
v=(v1+v)/2;
v=v*(5.0/18);
L=(v*t)/1000;
printf("weiyi:%.2fkm",L);
}
v=v*3.6;
printf("\nif enter #,stop:\nelse continue:");
getchar();
c=getchar();
if(c=='#')
exit(0);
else ;
goto sudugaibian;
return 0;
}[local]1[/local]请问为什么scanf("%d:%d:%d",&h1,&m1,&s1)这条语句没执行呢?