#8865: 求解


cse210623 (八仙鎮暴水車)


#include <iostream>

using namespace std ;

int main ()
{
int c ; 
while(cin >> c)
    {
    if (c%27==0)
        {
        cout << c/27;
        }
    else if (c%27!=0)
    {
    cout << c/27 +c%27/9 +c%27%9/3 +c%27%9%3<<endl;
    }
}
return 0;
}
 
不明白他所給的值為什麼我只跑出錯誤的 求大大幫忙修正錯誤  

#8866: Re:求解


cse210639 (210639)



#include <iostream>
using namespace std ;
int main ()
{
int a,b,c;
while(cin>>a)
for(b=0;b<a;b++)
{
cin>>c;
cout<<c/27+c%27/9+c%27%9/3+c%27%9%3<<endl;
}
return 0;
}