Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n;
- cin>>n;
- for(int i=0; i<=n; i++)
- {
- int ok = 0;
- for(int j=1; j<=9 && !ok; j++)
- {
- if(n%j != 0) continue;
- if(i%(n/j) == 0)
- ok = j;
- }
- if(!ok) cout<<'-';
- else cout<<ok;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment