fork download
  1. #include <bits/stdc++.h>
  2. using namespace std ;
  3. unsigned long long fib[86];
  4. int main()
  5. {
  6. fib[0] = 0 , fib[1] = 1;
  7. for (int i = 2 ; i <= 85 ; i++ )
  8. {
  9. fib[i] = fib[i-1] + fib[i-2];
  10. }
  11. string s;
  12. while(cin >> s)
  13. {
  14. unsigned long long res = 1,c = 1;
  15. if (s == "0") break;
  16. for (int i = 1 ; i < s.size() ; i++ )
  17. {
  18. int n = (s[i] - 48 ) + (s[i-1] - 48 )*10;
  19. if (n <= 26 ) c++;
  20. else
  21. {
  22. res *= fib[++c] , c = 1;
  23. }
  24. }
  25. cout << res * fib[++c]<< "\n";
  26. }
  27. }
  28.  
Success #stdin #stdout 0s 3464KB
stdin
25114
1111111111
3333333333
12912
11
26
27
0
stdout
6
89
1
4
2
2
1