- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
if(n==1) cout<<"A";
if(n==2) cout<<"B";
if(n==3) cout<<"AB";
if(n==4) cout<<"BAB";
if(n==5) cout<<"ABBAB";
if(n==6) cout<<"BABABBAB";
if(n==7) cout<<"ABBABBABABBAB";
if(n==8) cout<<"BABABBABABBABBABABBAB";
if(n==9) cout<<"ABBABBABABBABBABABBABABBABBABABBAB";
if(n==10) cout<<"BABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBAB";
if(n==11) cout<<"ABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBAB";
if(n==12) cout<<"BABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBAB";
if(n==13) cout<<"ABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBAB";
if(n==14) cout<<"BABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBAB";
if(n==15) cout<<"ABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBABABBABBABABBABBABABBABABBABBABABBAB";
return 0;
}
строки Фибаначи. (=
del 01.04.2010 23:52 # +0.8
winprogrammer 01.04.2010 23:59 # +0.6
guest 01.04.2010 23:59 # +3.4
striker 02.04.2010 06:22 # −0.8
guest 02.04.2010 07:27 # +0.6
zitzy 02.04.2010 09:51 # +0.2
winprogrammer 02.04.2010 20:54 # +0.4
guest 02.04.2010 22:20 # +0.4
nur 02.04.2010 11:39 # −0.8
guest 02.04.2010 13:13 # +6.2
crox 02.04.2010 16:12 # +2
guest 02.04.2010 22:48 # −0.4
guest 02.04.2010 19:51 # +1
TarasB 02.04.2010 20:52 # −1.8
guest 06.04.2010 21:41 # +1
guest 02.04.2010 21:49 # +1
guest 03.04.2010 22:28 # −3.6
guest 06.04.2010 10:02 # +3.6
guest 11.04.2010 00:52 # +2.2
{
if (n == 0) return string("A");
if (n == 1) return string("B");
return fib(n-2) + fib(n-1);
}
guest 11.04.2010 00:58 # +1
надо через прибавление к СтрингБилдеру содержимого того же СтрингБилдера
guest 11.04.2010 01:00 # −0.2
но в С++ будет как минимум стек оверфлоу, нет?
winprogrammer 11.04.2010 01:02 # 0
guest 11.04.2010 01:33 # 0
извиняйте, я в с++ не силён, только истинной с )
winprogrammer 11.04.2010 01:37 # 0
guest 11.04.2010 01:52 # 0
winprogrammer 11.04.2010 01:59 # 0
winprogrammer 11.04.2010 01:00 # +1.2
guest 11.04.2010 01:32 # +1.2
winprogrammer 11.04.2010 01:38 # +0.2
guest 11.04.2010 01:44 # +0.2
guest 14.04.2010 01:44 # 0
guest 14.04.2010 01:45 # 0