UVa 10300 - Ecological Premium
2013-02-25 17:49
267 查看
题目链接http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=24&problem=1241&mosmsg=Submission+received+with+ID+11339336
每个事件每一行的第一和第三相乘,总的相加即可
#include"stdio.h"
int main()
{
int apple,pea,orange,tomato,grape,potato;
scanf("%d",&apple);
while(apple--)
{
scanf("%d",&pea);
grape=0;
while(pea--)
{
scanf("%d%d%d",&orange,&tomato,&potato);
grape=grape+orange*potato;
}
printf("%d\n",grape);
}
return 0;
}
每个事件每一行的第一和第三相乘,总的相加即可
#include"stdio.h"
int main()
{
int apple,pea,orange,tomato,grape,potato;
scanf("%d",&apple);
while(apple--)
{
scanf("%d",&pea);
grape=0;
while(pea--)
{
scanf("%d%d%d",&orange,&tomato,&potato);
grape=grape+orange*potato;
}
printf("%d\n",grape);
}
return 0;
}
相关文章推荐
- UVA10300 - Ecological Premium
- UVa 10300 - Ecological Premium
- UVa 10300 Ecological Premium
- uva 10055 uva 10071 uva 10300(水题两三道)
- UVa - 10300 - Ecological Premium
- Uva 10300 Ecological Premium
- uva 10300 Ecological Premium
- uva 10300 Ecological Premium
- [UVa]10300-Ecological Premium
- [解题报告]《算法竞赛入门经典》基础题Volume 0. Getting Started Uva10055 Uva10071 Uva10300 Uva458 Uva494 Uva490 Uva445 Uva488 Uva489 Uva694 Uva457
- 算法竞赛入门经典-前四章-UVa10300 - Ecological Premium-生态奖金-难度0
- UVa10300 - Ecological Premium -难度0
- uva oj 10300
- UVa 10300 - Ecological Premium
- uva 10300 Ecological Premium
- UVA 10300 - Ecological Premium
- UVa 10300 Ecological Premium (water ver.)
- UVA - 10300 Ecological Premium(水题)
- UVA - 10300 Ecological Premium
- UVa10300 Ecological Premium