我的代码为什么输入什么结果都输出零
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
int n;//模拟次数
int k=1,count=0;
srand((unsigned)time(NULL));
double r;
int T1,T3,T2;
scanf("%d",&n);
while(k<=n)
{
r=rand()%2;
if(r>=0&&r<0.7)
T1=0;
else if(r>=0.7&&r<0.9)
T1=5;
else
T1=10;
r=rand()%2;
if(r>=0&&r<0.3)
T3=28;
else if(r>=0.3&&r<0.7)
T3=30;
else if(r>=0.7&&r<0.9)
T3=32;
else
T3=34;
T2=rand()%2;
if(T1+T2>T3)
count=count+1;
k=k+1;
}
printf("赶上火车的频率p为%lf",count/n*0.1);
}