0_0_22436850_11401.cpp: In function 'mat operator/(mat&, mat&)':
0_0_22436850_11401.cpp:28:28: error: 'else' without a previous 'if'
} else if(!f1&&!f2)//若都?1,那么负值为-1,相当于普通矩阵的0 r.b[i][j]=-1.0; } return r; } int pow_int(mat base,int k)//后四?
^
0_0_22436850_11401.cpp:28:37: error: 'f1' was not declared in this scope
} else if(!f1&&!f2)//若都?1,那么负值为-1,相当于普通矩阵的0 r.b[i][j]=-1.0; } return r; } int pow_int(mat base,int k)//后四?
^
0_0_22436850_11401.cpp:28:42: error: 'f2' was not declared in this scope
} else if(!f1&&!f2)//若都?1,那么负值为-1,相当于普通矩阵的0 r.b[i][j]=-1.0; } return r; } int pow_int(mat base,int k)//后四?
^
0_0_22436850_11401.cpp:29:110: error: 'k' was not declared in this scope
{ mat ans; memset(ans.a,0,sizeof(ans.a)); ans.a[1][1]=ans.a[2][2]=1; int cases=0; while(k) { if(k&1) ans=ans*base; base=base*base; k>>=1; } return ans.a[1][1]; } double pow_double(mat base,int k)//前四?
^
0_0_22436850_11401.cpp:29:155: error: 'base' was not declared in this scope
{ mat ans; memset(ans.a,0,sizeof(ans.a)); ans.a[1][1]=ans.a[2][2]=1; int cases=0; while(k) { if(k&1) ans=ans*base; base=base*base; k>>=1; } return ans.a[1][1]; } double pow_double(mat base,int k)//前四?
^
0_0_22436850_11401.cpp:29:169: error: 'base' was not declared in this scope
{ mat ans; memset(ans.a,0,sizeof(ans.a)); ans.a[1][1]=ans.a[2][2]=1; int cases=0; while(k) { if(k&1) ans=ans*base; base=base*base; k>>=1; } return ans.a[1][1]; } double pow_double(mat base,int k)//前四?
^
0_0_22436850_11401.cpp:29:227: error: could not convert 'ans.mat::a[1][1]' from 'int' to 'mat'
{ mat ans; memset(ans.a,0,sizeof(ans.a)); ans.a[1][1]=ans.a[2][2]=1; int cases=0; while(k) { if(k&1) ans=ans*base; base=base*base; k>>=1; } return ans.a[1][1]; } double pow_double(mat base,int k)//前四?
^
0_0_22436850_11401.cpp:30:2: error: a function-definition is not allowed here before '{' token
{ mat ans; ans.b[1][2]=ans.b[2][1]=-1.0; ans.b[1][1]=ans.b[2][2]=log10(1.0); while(k) { if(k&1) ans=ans/base; base=base/base; k>>=1; } int x=(int)ans.b[1][1]; ans.b[1][1]-=x; return pow(10.0,ans.b[1][1])*1000; } int main() { int p[40];//?9位预处理 p[0]=0; p[1]=1; for(int i=2; i<=39; i++) { p[i]=p[i-1]+p[i-2]; } while(~scanf("%d",&n)) { if(n<=39) printf("%d\n",p[n]); else { mat base; base.a[2][1]=base.a[1][2]=base.a[1][1]=1; base.a[2][2]=0; base.b[1][2]=base.b[2][1]=base.b[1][1]=log10(1.0); base.b[2][2]=-1.0; int r_ans=pow_int(base,n-1); int l_ans=(int)pow_double(base,n-1); printf("%d...%04d\n",l_ans,r_ans); } } }
^
0_0_22436850_11401.cpp:30:312: error: expected '}' at end of input
{ mat ans; ans.b[1][2]=ans.b[2][1]=-1.0; ans.b[1][1]=ans.b[2][2]=log10(1.0); while(k) { if(k&1) ans=ans/base; base=base/base; k>>=1; } int x=(int)ans.b[1][1]; ans.b[1][1]-=x; return pow(10.0,ans.b[1][1])*1000; } int main() { int p[40];//?9位预处理 p[0]=0; p[1]=1; for(int i=2; i<=39; i++) { p[i]=p[i-1]+p[i-2]; } while(~scanf("%d",&n)) { if(n<=39) printf("%d\n",p[n]); else { mat base; base.a[2][1]=base.a[1][2]=base.a[1][1]=1; base.a[2][2]=0; base.b[1][2]=base.b[2][1]=base.b[1][1]=log10(1.0); base.b[2][2]=-1.0; int r_ans=pow_int(base,n-1); int l_ans=(int)pow_double(base,n-1); printf("%d...%04d\n",l_ans,r_ans); } } }
^
|