- 博客(7)
- 资源 (1)
- 收藏
- 关注
翻译 01-复杂度2. Maximum Subsequence Sum (25)
#include#includeusing namespace std;int main(){ int n; while((cin>>n)!=NULL) { vector number; int temp; for(int i=0;i<n;i++) { cin>>temp; number.push_back(temp); } int maxsum=
2015-05-28 15:26:34 282
转载 01-复杂度1. 最大子列和问题(20)
#includeusing namespace std;#includeint main(){ int n; while((cin>>n)!=NULL) { vector number; int temp,maxsum=0,indexsum=0,index; for(int i=0;i<n;i++) { cin>>temp; number.push_bac
2015-05-28 09:52:31 333
原创 00-自测5. Shuffling Machine (20)
#includeusing namespace std;char *card[54]={"S1","S2","S3","S4","S5","S6","S7","S8","S9","S10","S11","S12","S13", "H1","H2","H3","H4","H5","H6","H7","H8","H9","H10","H11","H12","H13"
2015-05-28 09:29:14 283
转载 00-自测4. Have Fun with Numbers (20)
#include#include#includeusing namespace std;string doubleNumber(string num){ int n=num.size(); string res=""; int carry=0,sum; for(int i=n-1;i>=0;i--) { sum=(num[i]-'0')*2+carry; res.ins
2015-05-27 23:34:12 420
原创 00-自测2. 素数对猜想 (20)
//00-自测2. 素数对猜想 (20)#include#includeusing namespace std;bool prime(int num);int main(){ int n; while((cin>>n)!=NULL) { int su=0; for(int i=3;i<n-1;i+=2) { if(prime(i)&&prime(i+2))
2015-05-27 23:32:24 384
原创 00-自测1. 打印沙漏(20)
//00-自测1. 打印沙漏(20)#include#includeint main(){ int n; char x; while((scanf("%d",&n))!=EOF) { getchar(); scanf("%c",&x); int row; row=sqrt((n+1)*1.0/2); for(int i=0;i<row;i++) { f
2015-05-27 23:31:10 590
原创 00-自测3. 数组元素循环右移问题 (20)
#includeusing namespace std;int main(){int n,m;int num[100];while((cin>>n>>m)!=NULL){int flag=0;m = m % n;for(int i=0;icin>>num[i];for(int i=n-m;i{if(!flag){coutflag=
2015-05-27 23:16:47 866
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人