3 solutions

  • 0
    @ 2024-10-7 18:36:00

    #include <stdio.h> int main() { int m,k,i; int cnt=0; int digit; scanf("%d %d",&m,&k); for(i=0;i<=k;i++){ digit=m%10; m=m/10; if(digit3){ cnt++; } } if(cntk){ printf("YES"); }else{ printf("NO"); } return 0; }

    • 0
      @ 2023-10-25 16:05:10
      #include <stdio.h>
      #include<math.h>
      #pragma warning(disable:4996) 
      int main()
      {
          int m, k, temp = 0;
         
          scanf("%d%d", &m, &k);
          if (m % 19 == 0)
          {
              while (m)
              {
                  if (m % 10 == 3) temp ++ ;
                  m /= 10;
              }
          }
          if (temp == k)
          {
              printf("YES");
          }
          else
          {
              printf("NO");
          }
       
          return 0;
      }
      
      • 0
        @ 2023-10-10 20:25:27

        #include <stdio.h> int main() { long long m; int k=0; long long F; scanf("%lld",&m);

        F=m;
        do{
        	if((F%10)==3){
        		k++;
        	}
        	F/=10;
        } while(F!=0);
        
        if(m%19==0){
        	if(k==3){
        		printf("YES");
        	}
        }else {
        	printf("NO");
        }
        return 0;
        

        }

        • 1

        Information

        ID
        6756
        Time
        1000ms
        Memory
        128MiB
        Difficulty
        4
        Tags
        (None)
        # Submissions
        138
        Accepted
        64
        Uploaded By