Uva 10300 Ecological Premium
2011-03-09 07:57
281 查看
不用说的一道题,就是求每组三个数的第一个和第三个相乘的和。
#include<stdlib.h>
long int rows = 0;
int main(void)
{
while (scanf("%ld",&rows) != EOF)
{
int i = 0;
for(;i < rows;i++)
{
/*a,b,c用来输入每组的三个数,b其实是没有用的*/
long int n,j ,a ,b ,c ,sum = 0;
scanf("%ld",&n);
for( j = 0;j < n; j++)
{
scanf("%ld%ld%ld",&a,&b,&c);
sum += a*c;
}
printf("%ld/n",sum);
}
}
return 0;
}
#include<stdlib.h>
long int rows = 0;
int main(void)
{
while (scanf("%ld",&rows) != EOF)
{
int i = 0;
for(;i < rows;i++)
{
/*a,b,c用来输入每组的三个数,b其实是没有用的*/
long int n,j ,a ,b ,c ,sum = 0;
scanf("%ld",&n);
for( j = 0;j < n; j++)
{
scanf("%ld%ld%ld",&a,&b,&c);
sum += a*c;
}
printf("%ld/n",sum);
}
}
return 0;
}
相关文章推荐
- UVA 10300 - Ecological Premium
- UVa 10300 Ecological Premium (water ver.)
- UVA - 10300 Ecological Premium(水题)
- UVA - 10300 Ecological Premium
- UVa10300 Ecological Premium
- UVA10300(理解题意就容易切)
- uva 10300 - Ecological Premium
- acm-UVA10300(水题,纯粹考英语)
- UVA 10300-Ecological Premium
- UVa 10300 - Ecological Premium
- uva-10300 - Ecological Premium
- UVa 10300 - Ecological Premium
- uva10300 Ecological Premium
- UVA 10300
- Ecological Premium - UVa10300
- Uva10300
- Ecological Premium - UVa10300
- UVA:10300 - Ecological Premium
- UVa 10300 Ecological Premium(生态奖金)
- UVA oj 10300 Ecological Premium(水题)