asgarlikanan

https://www.e-olymp.com/az/problems/128

Aug 19th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
4CS 0.48 KB | None | 0 0
  1. /*
  2.     Author: Kanan Asgarli
  3.     https://www.e-olymp.com/az/problems/128
  4. */
  5. #include <iostream>
  6. #include <algorithm>
  7. using namespace std;
  8. int N, ans;
  9. int main()
  10. {
  11.     cin>>N;
  12.     for(int i = 0; i < 10; i++)
  13.         for(int j = 0; j < 10; j++)
  14.             for(int k = 0; k < 10; k++)
  15.                 for(int l = 0; l < 10; l++)
  16.                     for(int m = 0; m < 10; m++)
  17.                         for(int n = 0; n < 10; n++)
  18.                             if(i + j + k == l + m + n && i + j + k == N)
  19.                                 ans++;
  20.     cout<<ans<<endl;
  21.     return 0;
  22. }
Add Comment
Please, Sign In to add comment