Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: Kanan Asgarli
- https://www.e-olymp.com/az/problems/128
- */
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int N, ans;
- int main()
- {
- cin>>N;
- for(int i = 0; i < 10; i++)
- for(int j = 0; j < 10; j++)
- for(int k = 0; k < 10; k++)
- for(int l = 0; l < 10; l++)
- for(int m = 0; m < 10; m++)
- for(int n = 0; n < 10; n++)
- if(i + j + k == l + m + n && i + j + k == N)
- ans++;
- cout<<ans<<endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment