Consider there are n positive integers representing total number of Trains running between Station RS[0] and RS[d-1]. RS is the array containing Railway Stations in order of sequence of the stations located one after other. The d represents the total number of the stations. RS[0] and RS[d-1] are the stations at both ends. There is another array T of the size d which is equal to the size of RS. T represents the time in minutes between the last and current station. Array positions can be mapped for RS and T in such a way that the train will take time T[k] to reach the station RS[k] from station RS[k-1].
N trains starts at RS[0] at different timestamps represented by float value to indicate hour value before precision point and minute value after precision point. (11.30)
Values of RS and T are given as -
RS[0] = PANVEL T[0] = 0
RS[1] = KHANDESHWAR T[1] = 4
RS[2] = MANSAROVAR T[2] = 5
RS[3] = KHARGHAR T[3] = 3
RS[4] = BELAPUR T[4] = 4
RS[5] = SEAWOOD T[5] = 5
RS[6] = NERUL T[6] = 3
Answers
Answer:
9+4=13
Explanation:
shzhddbnedfvnncddgnjdsnjd
Answer:
#include<stdio.h>
#include<string.h>
int main()
{
char rs[20][10]={"pavel","khandeswar","mansarovor","kharghar","belapur","seawood","nerul"};
int a[10]={0,4,5,3,4,5,3},i,sum=0,c,f;
float b[11]={7.30,8.2,12.45,13.0,14.44,15.50,9.15,10.20,23.59,17.33,19.20};
int n=sizeof(a)/sizeof(int);
int n1=sizeof(rs)/sizeof(int);
float d;
char e[10];
printf("enter the time in float");
scanf("%f",&d);
printf("['pavel','khandeswar','mansarovor','kharghar','belapur','seawood','nerul']\n");
printf("At which station you are right now\n");
scanf("%s",e);
for(i=0;i<n;i++)
{
if(d>=b[i] && d<=b[i+1])
{
c=i+1;
break;
}
}
for(i=0;i<n1;i++)
{
if(strcmp(e,rs[i])==0)
{
f=i;
}
}
for(i=0;i<f;i++)
{
sum=sum+a[i];
}
printf("%d",c+sum);
return 0;
}