Advertisement
Zuneve

wda

Nov 3rd, 2022
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. using namespace std;
  5. int main() {
  6. string s;
  7. cin >> s;
  8. vector <int> a(26);
  9. a[0]=1;
  10. a[1]=1;
  11. for (int i = 2; i<26; i++) {
  12. a[i]=a[i-2]+a[i-1];
  13. }
  14. for (int i = 0; i<s.size(); i++) {
  15. for (int j = 0; j<26; j++) {
  16. if (i+1==a[j]) {
  17. cout << s[i];
  18. break;
  19. }
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement