ZOJ 1057 Undercut (格式问题)
来源:互联网 发布:一般淘宝代购是正品吗 编辑:程序博客网 时间:2024/06/05 04:33
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1057
做题的时候一定要看清题意,提交之前一定要再 看一遍样例输出的格式。
就是这样的一句话
where the value of a and b are for you to determine. A blank line should separate output lines.
有多少人WA了!!!!!
#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#define inf 999999999using namespace std;int a[100],b[100];int main(){ //freopen("2.txt","w",stdout); int n,count = 0; while(cin>>n && n) { if(count) cout<<endl;/*输出空行*/ count++; int i,j,scorea = 0, scoreb = 0; for(i = 0; i < n; i++) cin>>a[i]; for(i = 0; i < n; i++) { cin>>b[i]; if(a[i] + b[i] == 3) { if(a[i]>b[i]) scoreb += 6; else scorea += 6; } else if(abs(a[i] - b[i]) == 1) { if(a[i] > b[i]) scoreb += (a[i] + b[i]); else scorea += (a[i] + b[i]); } else if(a[i] == b[i]) continue; else { //if(i == 0) cout<<a[i]<<"********"<<b[i]<<endl; if(a[i] > b[i]) scorea += a[i];//,cout<<a[i]<<"**"<<scorea + a[i]<<endl; else scoreb += b[i]; } } cout<<"A has "<<scorea<<" points."<<" B has "<<scoreb<<" points."<<endl; //cout<<endl; } return 0;}
0 0
- ZOJ 1057 Undercut (格式问题)
- ZOJ-1057-Undercut
- ZOJ 1057 Undercut
- zoj 1057 Undercut 水题
- ZOJ--1057:Undercut
- ZOJ Problem Set - 1057||Undercut
- 1057 Undercut
- Undercut
- Undercut
- Undercut
- ZOJ1057 Undercut
- JOJ1087: Undercut
- fjnu 1824 Undercut
- ZOJ 1005 Jugs (倒水问题)
- HDOJ-3788 ZOJ问题(递推)
- hdoj 3788 zoj问题(递推)
- zoj 1088 约瑟夫环问题(模拟)
- zoj 1610(线段树染色问题)
- Win 7 装MAC
- Struts2返回JSON对象的方法总结
- 【Android组件】---之---VLC视频播放组件
- nf_conntrack: table full, dropping packet问题的解决思路
- 【模式匹配】KMP算法的简明理解
- ZOJ 1057 Undercut (格式问题)
- 富豪应多做慈善事业
- java谜题1:奇数性
- codeforces #199 C. Cupboard and Balloons 题解
- 08-remove @Override annotation错误
- Best Time to Buy and Sell Stock II -- LeetCode
- dll和exe的共享节------多进程共享dll/exe全局变量
- 火星坐标和正常坐标之间的转换
- 我们为什么而活