Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- int main() {
- string s;
- cin >> s;
- vector <int> a(26);
- a[0]=1;
- a[1]=1;
- for (int i = 2; i<26; i++) {
- a[i]=a[i-2]+a[i-1];
- }
- for (int i = 0; i<s.size(); i++) {
- for (int j = 0; j<26; j++) {
- if (i+1==a[j]) {
- cout << s[i];
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement