Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int m, n;
- cin >> n;
- cin >> m;
- n*=n;
- bool b = true;
- int dec=1;
- int taille=0;
- while(b)
- {
- if(n-dec>0)
- {
- taille++;
- dec*=10;
- }
- else
- {
- b=false;
- }
- }
- int nb = 0;
- for(int i=taille;i>0;i--)
- {
- dec=dec/10;
- int compteur=0;
- while(n>=dec)
- {
- n=n-dec;
- compteur++;
- cout << compteur;
- }
- if(compteur==m)
- nb++;
- }
- cout << nb;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement