12月将举办首届西电ACM新生赛,敬请期待~~~~
Xidian Online Judge WebBoard
[ New Thread ]
Problem 1081 >> wa的T……T
112 @ 2015-08-16 17:30:28
[ Quote ] [ Edit ] [ Delete ] 1#
代码:
#include<stdio.h>
int main()
{
long a1,a2,b1,b2,c1,c2,d1,d2,max,min;
while((scanf("%d %d %d %d %d %d %d %d",&a1,&a2,&b1,&b2,&c1,&c2,&d1,&d2))!=EOF)
{
max=a2*d2-b1*c1;
min=a1*d1-b2*c2;
if((min<=0&&max>=0))
printf("YES\n");
else
printf("NO\n");
}
return 0;
}
为什么wa呀T……T,求解释
adminlight @ 2015-08-17 18:05:34
[ Quote ] [ Edit ] [ Delete ] 2#
test.cpp:5:71: 警告:格式 ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long int*’ [-Wformat=]
while((scanf("%d %d %d %d %d %d %d %d",&a1,&a2,&b1,&b2,&c1,&c2,&d1,&d2))!=EOF)
^
test.cpp:5:71: 警告:格式 ‘%d’ expects argument of type ‘int*’, but argument 3 has type ‘long int*’ [-Wformat=]
test.cpp:5:71: 警告:格式 ‘%d’ expects argument of type ‘int*’, but argument 4 has type ‘long int*’ [-Wformat=]
test.cpp:5:71: 警告:格式 ‘%d’ expects argument of type ‘int*’, but argument 5 has type ‘long int*’ [-Wformat=]
test.cpp:5:71: 警告:格式 ‘%d’ expects argument of type ‘int*’, but argument 6 has type ‘long int*’ [-Wformat=]
test.cpp:5:71: 警告:格式 ‘%d’ expects argument of type ‘int*’, but argument 7 has type ‘long int*’ [-Wformat=]
test.cpp:5:71: 警告:格式 ‘%d’ expects argument of type ‘int*’, but argument 8 has type ‘long int*’ [-Wformat=]
test.cpp:5:71: 警告:格式 ‘%d’ expects argument of type ‘int*’, but argument 9 has type ‘long int*’ [-Wformat=]
[Top] [Previous Page] [Next Page]
Anything about the Problems, Please Contact Admin:admin
All Copyright Reserved 2010-2014 Xidian ACM Online Judge TEAM
GPL2.0 2003-2014 HUSTOJ Project TEAM