Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <math.h>
  4. #include <stdio.h>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     freopen("INPUT.TXT", "r", stdin);
  11.     freopen("OUTPUT.TXT", "w", stdout);
  12.     long long a, b=0;
  13.     int t=0;
  14.     cin>>a;
  15.     long long int m=a;
  16.  
  17.     for(int i=1; i<a; i++)
  18.     {
  19.         for(int j=i; j<a || b<a; j++)
  20.         {
  21.             b+=j;
  22.         }
  23.         if(b==a)
  24.             t++;
  25.     }
  26.     cout<<t;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement