poj 1247 Magnificent Meatballs
2011-07-17 23:55
399 查看
#include <iostream> using namespace std; int main() { int n,list[31],total,i; while(cin>>n&&n) { total=0; for( i=1;i<=n;i++) { cin>>list[i]; total+=list[i]; } if(total%2!=0) cout<<"No equal partitioning.\n"; else { total/=2; int sum=0; for( i=1;;i++) { sum+=list[i]; if(sum>=total) break; } if(sum==total) cout<<"Sam stops at position "<<i<<" and Ella stops at position "<<i+1<<".\n"; else cout<<"No equal partitioning.\n"; } } return 0; }
相关文章推荐
- poj1247 Magnificent Meatballs
- POJ 1247 Magnificent Meatballs
- POJ 1247 Magnificent Meatballs
- poj 1247 Magnificent Meatballs
- poj 1247 Magnificent Meatballs 解题报告
- poj 1247 Magnificent Meatballs
- POJ 1247 Magnificent Meatballs 笔记
- POJ 1247 Magnificent Meatballs
- POJ1247-Magnificent Meatballs
- poj 1247 Magnificent Meatballs 解题报告
- POJ 1247 Magnificent Meatballs(我的水题之路——数组两边求和)
- Magnificent Meatballs - 1247
- 1247 Magnificent Meatballs
- acm pku 1247 Magnificent Meatballs的算法实现
- POJ 1247 Magnificent Meatballs(水~)
- 【模拟】poj1247 Magnificent Meatballs
- ZOJ 1402 Magnificent Meatballs
- ZOJ Problem Set - 1402 Magnificent Meatballs
- Magnificent Meatballs
- zoj 1402 Magnificent Meatballs