贡献了两个compile erroe

代码如下:

#include<stdio.h>
int main()
{
 int a,b,c,d,t;
 double e,f;
 while(scanf("%d %d %d %d",&a,&b,&c,&d),a||b||c||d)
 {
  if(a<b) {t=a;a=b;b=t;}
  if(c<d) {t=c;c=d;d=t;}
  e=(double)(c)/a;f=(double)(d)/b;
  if(e>1&&f>1)
   printf("100%%\n");
  else
   printf("%d%%\n",(int)((e>f?f:e)*100));
 }
 return 0;
}

第一次错误(在gcc下)

类型强制转换int要有括号

Main.c: In function `main':
Main.c:13: error: syntax error before "int"
Main.c:13: error: syntax error before '>' token

第二次错误(在c下)

也是int没有括号的关系

posted on 2008-11-08 22:09  pandy  阅读(229)  评论(0编辑  收藏  举报