| ||||||||||
Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
农夫约翰你在大学主修数学,喜欢数学,就不能加强一下数据吗?//暴力解 #include<iostream> using namespace std; int n; int cnt, abc; int ans; int main(){ cin >> n; for(int i = 1; i <= n; ++i){ cnt = 0, abc = i; while(cnt < n && abc > 0){ cnt += abc; --abc; } if(cnt == n){ ++ans; } } cout << ans << endl; return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator