木其网络科技专业程序员代写http://www.xmsydw.com
程序员学历擅长经验网店链接
apenny硕士ASP.NET PHP 电子 通信设计 图像 编程 网络5年进入店铺
zheng_qianqian本科C语言 C++面向对象 Java3年进入店铺
guoguanl本科Java Web项目 JSP Hibernate Struts Mysql4年进入店铺
摘要: GCD最大公约数int gcd(int x,int y) { if(!x || !y) return x>y?x:y; for(int t;t=x%y;x=y,y=t); return y; }快速GCDint kgcd(int a,int b) { if(a==0) return b; if(b==0) return a; if(!(a & 1) && !(b & 1)) return kgcd(a>>1,b>>1)>1); else if(!(a & 1)) return kgcd(a>>1,b); e 阅读全文
posted @ 2013-05-17 20:36 C语言程序 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 递推求欧拉函数phi(i):for(i=1;i1) res=res/x*(x-1); return res; } 阅读全文
posted @ 2013-05-17 20:27 C语言程序 阅读(717) 评论(0) 推荐(0) 编辑
摘要: 问题:ubuntu下编写测试下标运算符[]重载的程序。使用while (cin >> buf)将接收到的字符串存储到string buf中,不知道该怎样结束cin的输入操作;解决办法:1. 放狗搜,结论是linux下使用Ctrl+d,windows下使用Ctrl+z来结束键盘输入。源程序如下:#include #include using namespace std; class Assoc { struct Pair { string name; double val; Pair (string n = "", double v... 阅读全文
posted @ 2013-05-17 20:10 C语言程序 阅读(810) 评论(0) 推荐(0) 编辑
摘要: //Time 47ms,Memory 248k#include #include using namespace std; double d[22]; typedef struct point { double x,y; point(double x=0,double y=0):x(x),y(y){} }vector; point p[22]; double cross(vector a,vector b) { return a.x*b.y-a.y*b.x; } int f(int a,double s,point i,point j,double &right) { vector . 阅读全文
posted @ 2013-05-17 18:45 C语言程序 阅读(122) 评论(0) 推荐(0) 编辑
摘要: //Time 0ms,Memory 504KB#include #include using namespace std; int v[25][25],p[25][25],m,n; int dfs(int cur,int d) { int x,y; x=cur/m+1;y=cur%m+1; if(cur>=n*m) return 1; if(y+dm) { if(x==n) { if(p[x][y]==0) return 1; else ret... 阅读全文
posted @ 2013-05-17 15:29 C语言程序 阅读(125) 评论(0) 推荐(0) 编辑
木其网络科技专业程序员代写http://www.xmsydw.com
程序员学历擅长经验网店链接
apenny硕士ASP.NET PHP 电子 通信设计 图像 编程 网络5年进入店铺
zheng_qianqian本科C语言 C++面向对象 Java3年进入店铺
guoguanl本科Java Web项目 JSP Hibernate Struts Mysql4年进入店铺