为什么只有百分之40通过率
#include"iostream"
using namespace std;
int main()
{
long long x,t;
int i, n = 0,a=0;
cin >> x;
t = x;
while (x != 0)
{
x /= 10;
a++;
}
for (i = 0; i < a; i++) {
if (t % 9 == 0) {
n++;
}
t = t / 10;
}
cout << n;
}
#include"iostream"
using namespace std;
int main()
{
long long x,t;
int i, n = 0,a=0;
cin >> x;
t = x;
while (x != 0)
{
x /= 10;
a++;
}
for (i = 0; i < a; i++) {
if (t % 9 == 0) {
n++;
}
t = t / 10;
}
cout << n;
}
相关推荐