Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- long long i,n,a[1010],k;
- int main()
- {
- cin>>n;
- for(i=100; i<=1000; i++)
- if(i%10 + i/100 +i/10%10 ==n)k++;
- cout<<k<<endl;
- for(i=100; i<=1000; i++)
- if(i%10 + i/100 +i/10%10 ==n)cout<<i<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement