#include<stdio.h> int main() { long long a,b,d=5001,e,f,c/*=0*/; scanf("%lld%lld",&a,&b); for(short i=0;i<a;i++) { scanf("%lld%lld",&e,&f); if(e<d) { d=e; } c+=d*f; d+=b; } printf("%lld",c); }
这是一个WA代码,但是定义c=0(注释位置)就会AC,为什么