Skip to content

Instantly share code, notes, and snippets.

@ik11235
Created June 27, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ik11235/42680d8370bcb86fcefa to your computer and use it in GitHub Desktop.
Save ik11235/42680d8370bcb86fcefa to your computer and use it in GitHub Desktop.
#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