代码如下,已加注释,非常感谢!!!
#include <stdio.h>
#include <math.h>
int main(int argc, const char * argv[])
{
long x1, y1, n, numRen;
double s, t, T = 0;
scanf("%ld", &n);
for(; n != 0; n--)
{
scanf("%ld %ld %ld", &x1, &y1, &numRen);
s = sqrt(x1 * x1 + y1 * y1);
t = s / 50 * 2 + (1 + 0.5) * numRen;
T += t;
}
if(T > (long)T)
T = (long)T + 1;
printf("%ld",(long)T);
return 0;
}