Algorithm
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include <bits/stdc++.h>
using namespace std;
int n, k;
int main() {
scanf("%d %d", &n, &k);
if(n > 1 && k == 0) {
puts("No solution");
return 0;
}
printf("%d", k);
if(n == 1)
return 0;
for(int i = 1; i < n; ++i)
printf("0");
puts("");
return 0;
}
Copy The Code &
Try With Live Editor
Input
4 4
Output
5881
Demonstration
Codeforces Solution-Vasya and Digital Root-Solution in C, C++, Java, Python