第一题: #include <iostream>  using namespace std;   int main()  {     long long n;     cin>>n;     int num[100];     int a=0;     while(n)     {         num[a]=n%10;         a++;         n=n/10;     }     int ans=0;     long long temp=0;     for(int j=a-1;j>=0;j--)     {         if(num[j]%3==0&&temp==0)         {             ans++;         }         else         {             temp+=num[j];             if(temp%3==0)             {                 ans++;                 temp=0;             }         }     }     cout << ans << endl;     return 0; } 求问:为什么只能通过66.17%?系统还不给通不过的测试用例
点赞 4

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务