Codeforces 1335B - Construct the String Solution

  1. Solution in C++:
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. int main()
  5. {
  6. int n,a,b,t,i;
  7. char c;
  8. while(cin>>t)
  9. {
  10. while(t--)
  11. {
  12. cin>>n>>a>>b;
  13. for(i=0; i<n; i++)
  14. {
  15. cout<<char('a'+i%b);
  16. }
  17. cout<<endl;
  18. }
  19. }
  20.  
  21. }

No comments

Most View Post

Recent post

Codeforces Round 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h &g...

Powered by Blogger.