试试这个。
#include <stdio.h>
int main(int argc, char *argv[])
{
int i,j,station,ticketnum=0;
printf("Please input the station num (such as 10):");
scanf("%d",&station);
for(i=1;i<station;i++)
for(j=i;j<station;j++)
ticketnum++;
ticketnum=ticketnum*2;
printf("need %d kinds of ticket\n",ticketnum);
return 0;
}