Created
June 27, 2015 14:25
-
-
Save ik11235/42680d8370bcb86fcefa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<algorithm> | |
#include<iostream> | |
using namespace std; | |
int main() | |
{ | |
string s; | |
cin>>s; | |
int n; | |
cin>>n; | |
int a=0,b=0; | |
for(int i=1;i<n;i++) | |
{ | |
b++; | |
if(b>=s.size()) | |
{ | |
a++; | |
b=0; | |
} | |
} | |
cout<<s[a]<<s[b]<<endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment