TOPIC

meu codigo funciona na ide mas o uri discorda.

Matheus pimentel pilotto asked 8 months ago

#include <stdio.h>

int main() {
  int x,y,sub,div,xx,contador;
  scanf("%i %i",&x,&y);
  sub=y-x;
  contador=0;
  while(sub>=0){
    xx=x;
    sub--;
    int a1,b2,c3,d4,e5,f6,g7,h8,k9,l0;
    a1=0;
    b2=0;
    c3=0;
    d4=0;
    e5=0;
    f6=0;
    g7=0;
    h8=0;
    k9=0;
    l0=0;
  while(xx>0){
    if(xx%10==0){
      l0++;}
    if(xx%10==1){
      a1++;}
    if(xx%10==2){
      b2++;}
    if(xx%10==3){
      c3++;}
    if(xx%10==4){
      d4++;}
    if(xx%10==5){
      e5++;}
    if(xx%10==6){
      f6++;}
    if(xx%10==7){
      g7++;}
    if(xx%10==8){
      h8++;}
    if(xx%10==9){
      k9++;}

    xx= (xx/10); 
  }
  if(2>a1 && 2>b2 && 2>c3 && 2>d4 && 2>e5 && 2>f6 && 2>g7 && 2>h8 && 2>k9 && 2>l0){
    contador++;  }
  x++;
  }
  printf("%i",contador);
    return 0;
}

Remember not post solutions. Your post may be reviewed by our moderators.

  • feodorv replied 8 months ago

    The judge input contains several test cases. Your code reads only first test case.