摘要:
Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N!高精度处理,用字符串来存储。#include"iostream"using namespace std;char ans[35661];//10000的时候是35660位数int main(){ int n; while(cin>>n) { int i,digit=1; ans[0]=1; for(i=2;i<=n;i++) { int j,k; for(j=k=0;j<digit;j++) { int temp=ans[j] 阅读全文
摘要:
2176在简单的NIM游戏上输出取法策略AC代码:#include"iostream" using namespace std; int main() { int m; while(cin>>m,m) { int ans=0,i,s[200001]; for(i=0;i<m;i++) { cin>>s[i]; ans^=s[i]; } if(ans==0) { cout<<"No"<<endl; continue; } cout<<"Yes"<<endl; 阅读全文