#include <stdio.h>
int main()
{
int a,b,c;
int i=0;
for(a=1;a<=5;a++)
for(b=1;b<=5;b++)
for(c=1;c<=5;c++)
if(a != b && a != c && b != c)
{
printf("A:%2d,B:%2d,C:%2d\n",a,b,c);
i++;
}
printf("There are %d ways",i);
return 0;
}
int main()
{
int a,b,c;
int i=0;
for(a=1;a<=5;a++)
for(b=1;b<=5;b++)
for(c=1;c<=5;c++)
if(a != b && a != c && b != c)
{
printf("A:%2d,B:%2d,C:%2d\n",a,b,c);
i++;
}
printf("There are %d ways",i);
return 0;
}