70,求助!

B2078 含 k 个 3 的数

LINTCODE @ 2022-09-25 09:51:45

#include<stdio.h>
int main()
{
 long long int m;
 int k,x=0,i,b;
 scanf("%ld%d",&m,&k);
 i=m;
 for(i;i>0;i=m/10)
 {
 m=i;
 b=m%10;
 if(b==3) ++x;
 }
 if(x==k) printf("YES\n");
 else printf("NO\n");
 return 0;
}

by simonG @ 2022-09-25 10:29:27

i 要开 long long int


by LINTCODE @ 2022-09-25 10:31:49

@gaosichensb orz 感谢大佬


|