Thursday, 6 April 2017

Geeksforgeeks Solution For " Nth digit in sequence "

GeeksforGeeks Solution For Hard Domain .Below You Can Find The Solution Of  School Basic ,Easy ,Medium . Or Hackerrank Solution You Can Also Direct Submit Your Solution to Geeksforgeeks Same Problem .You Need to login then you can submit you answers 

Problem :- Nth digit in sequence

Submit Your Solution :- Click Here 

Solution :- 

#include <iostream>
using namespace std;

int main()
{
string fib;
int M=100000;
for (int i =1;i<=M;i++)
{
fib+=to_string(i);
}

int t, n;
cin >> t;
while(t--)
{
cin >> n;
cout <<fib[n-1] << endl;

}
}

Output:-



Geeksforgeeks Solution For " Nth digit in sequence "

No comments:
Write comments

Recommended Posts × +