谁帮我看看这个C语言题目我哪错的

[复制链接]
查看11 | 回复2 | 2010-12-20 16:35:35 | 显示全部楼层 |阅读模式
Problem Description
The Asian Games is coming soon. And SMU likes sports very much. But he must prepare for the postgraduate entrance examination. So he has just one day free. Of course, he wants to see matches as many as possible on that day. Thus he wants to know how many matches he can watch at most. But it is boring to arrange the schedule. You, who are good at programming, want to help him as SMU’s best friend.
Input
The first line contains an integer T which means the number of test cases.Each test case starts with a line containing one integer N(0
#include
int main()
{
int n,m,i,j,k,t,sum;
char ch[1001][2],st[1001][2];

scanf("%d",&n);
for(i=1;ist[j-1][0])

k++;
if(ch[j][0]=st[j-1][0])
{

if(ch[j][1]>st[j-1][1])

k++;

if(ch[j][1]=st[j-1][1])

{

t=(ch[j][3]-'0')*10+(ch[j][4]-'0');

sum=(st[j-1][3]-'0')*10+(st[j-1][4]-'0');

if(t>sum)

k++;

}
}
}
printf("Case %d: %d\n",i,k);
}
}
运行起来就有问题啊 哪个好心的大牛帮我改下 啊

回复

使用道具 举报

千问 | 2010-12-20 16:35:35 | 显示全部楼层
楼上的朋友,你们有没运行过程序啊,像你们那样改也不对,一样得不到正确的结果正确的是:pmax=&a,pmin=&a; 这句不要了.所以修改后程序如下:#includevoid main() { int a[3],*pmax,*pmin,i; printf("Please input three number:");for(i=0;i<3;i++) { scanf("%d",&a); } *pmax=a[0]; *pmin=a[0]; for(i=0;i<3;i++) { if(*pmax<a)*pmax=a;
回复

使用道具 举报

千问 | 2010-12-20 16:35:35 | 显示全部楼层
题目是什么,运行之后没错啊
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行