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; void main() { int root, a; while ( cin >> a) { if (a == 0) return; root = a; while (root >= 10) { a = a / 10 + a % 10; root = a; } cout << root << endl; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator