你们来做小老师

B2078 含 k 个 3 的数

Xiaonao_Dali @ 2023-10-29 14:09:16

求求问一下哪```

include <iostream>

using namespace std;

int main() { int m, k, n, b, i; cin >> m >> k;

n = m;
i = 0;
while (n >= 1)
{
    b = n % 10;
    if (b == 3)
    {
        i++;
    }
    n /= 10;
}
if(i==k){
    printf("YES");
}
else{
    printf("NO");
}
return 0;

}


错了

by zenglicheng666 @ 2024-06-10 12:07:08

![

~~~~~~**```

include<bits/stdc++.h>

using namespace std;

int main() { long long k; int sum = 0; string a; cin >> a >> k; for (int i = 0; i < a.size(); i++) { if (a[i] - '0' == 3) { sum++; } } if (sum == k) { cout << "yes"; } else { cout << "no"; } return 0; }


**~~~~~~~~~~~~~~~~~~](文件夹)![]()

by zhouyuhang @ 2024-07-15 14:18:05

@EastSnowLotus 不是一小时 1k 吗?


上一页 |