基本运用,基本是模板题。
求fi【n】. (1,1) *( 1 )
( 1,0) ( 0)
#include#include using namespace std; struct juz { int bat[3][3]; int x,y; //行 列 }; juz mutp(juz a,juz b) { juz c; c.x=a.x;c.y=b.y; memset(c.bat,0,sizeof(c.bat)); for(int k=0;k =1) { if(k%2) c=mutp(c,a); k=k/2; a=mutp(a,a); } return c; } int main() { int n; while(cin>>n&&n!=-1) { if(n==0) { cout<<0<