查看运算符的优先级
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i,sum=0;
long n;
while(scanf("%ld",&n)!=EOF)
{
while(n)
{
if(n%3==0)
{
sum+=n/3;
n=n/3;
}
else
{
sum+=n/3+1;
n=n/3+1;
}
}
printf("%d",sum);
}
return 0;
}
[此贴子已经被作者于2007-4-15 13:52:50编辑过]