Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  project
Language: C/C++
Code:
#include <stdio.h>
#include<string.h>
struct trainr
{
char rt[2];
}s[3];
struct trainc
{
char ct[2];
}s1[4];
main()
{
int m,n,mt[3],nt[4];
int a,b,c,d,e,i,count=0,count1=0,count2=0;
scanf("%d%d",&m,&n);
for(i=0;i<3;i++)
{
scanf(%s",s[i].rt);
scanf("%d",&mt[i]);
}
for(i=0;i<4;i++)
{
scanf("%s",s1[i].ct);
scanf("%d"&nt[i]);
}
scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
if(d==1)
{
count=c+2;
}
if(strcmp((s[0].rt),"f")==0)
{
count1=count+3;
}
if((d==1)&&(e==1))
{
count2=count1+2;
}
printf("n%d",count2);
}

          
          
Comments: