Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int x,lv,ln,k;
- char s[10000];
- cin>>x>>k;
- cin>>s;
- if(x<9)
- {
- lv=1;
- ln=1;
- }
- if(x==9)
- {
- lv=1;
- ln=2;
- }
- if(x>9)
- {
- lv=2;
- ln=2;
- }
- while(ln<k)
- {
- ln=ln+lv;
- lv=ln-lv;
- }
- s[k-lv+1]=0;
- cout<<s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement