井道灯套什么定额:帮我看个程序

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/01 21:39:37
在本机上可以实现,可在浙大的ACM系统上就是AC不了
#include <iostream>
using namespace std;
int main()
{
int m;
while(cin>>m)
{
int sum=0;
if(m==0)
break;
else
while(1)
{
sum+=m%10;
m=m/10;
if(m==0)
{
if(sum<10)
break;
else{
m=sum;
sum=0;
}

}
}
cout<<sum<<endl;
}
return 0;
}

不知道那道题目
但作acm的时候最好写
#include <iostream.h>