Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
简短AC代码,pell方程打的表#include <cstdio> int main() { printf("\ 6 8\n\ 35 49\n\ 204 288\n\ 1189 1681\n\ 6930 9800\n\ 40391 57121\n\ 235416 332928\n\ 1372105 1940449\n\ 7997214 11309768\n\ 46611179 65918161\n\ "); return 0; } -------------------------------------------------------------------------------------------------------------------------------------------------//我是分界线 //pell方程 #include <cstdio> using namespace std; const int MAXN=105; int x[MAXN],y[MAXN]; int main() { x[0]=3;y[0]=1; for(int i=1;i<=10;i++) { x[i]=x[i-1]*x[0]+8*y[i-1]*y[0]; y[i]=x[0]*y[i-1]+y[0]*x[i-1]; printf("%10d%10d\n",y[i],(x[i]-1)/2); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator