Codeforces 1177A A. Digits Sequence (Easy Edition) Solution

Solve in C++:

#include<bits/stdc++.h>
using namespace std;
main ()
{
    int n,i,sum=0;
    string st;
    cin>>n;
    for(i=0;i<5000;i++)
    {
        st=st+to_string(i);

    }
    cout<<st[n]<<endl;
    return 0;
}

No comments

Most View Post

Recent post

RESTful APIs with CRUD Operations in Laravel 12| (2025)

  RESTful APIs serve as the foundation of modern web development. They follow a set of rules called Representational State Transfer (REST) t...

Powered by Blogger.