UVA Problem 12527 Solution – Different Digits

Problem Solving, UVa

 

 

#include<stdio.h>



int main()

{

int n,m,ro,a[20],num,i,j,digit,k,count;

while(scanf("%d %d",&n,&m)==2)

{

    ro=0;

    for(i=n;i<=m;i++)

    {

        num=i;

        digit=0;

        while(num>0)

        {

           a[digit++]=num%10;

            num/=10;

        }

        count=0;

        for(j=0;j<digit-1;j++)

        {

            for(k=j+1;k<digit;k++)

            {

                if(a[j]==a[k])

                {

                    count=1;

                    break;

                }

            }

           

        }

        if(count==0)

        {

            ro++;

        }

  

    }

   printf("%d\n",ro);

}

return 0;



}

 

0 Comments

You may find interest following article

Complete Guide: Create Laravel Project in Docker Without Local Dependencies

Create Laravel Project Through Docker — No Need to Install PHP, MySQL, or Apache on Your Local Machine In this tutorial, I’ll show you how to create and run a full Laravel project using Docker containers. That means you won’t have to install PHP, MySQL, or Apache locally on your computer. By the end of this guide, you’ll have a fully functional Laravel development...