#include <stdio.h>
int main()
{
int m;
scanf("%d",&m);
int a = m/100;
int b = (m/10)%10;
int c = (m%100)%10;
if(m>=100 && m<=999)
{
if(a==b==c) //
{
printf("no\n");
}
else if((a==b)||(a==c)||(b==c))
{
printf("yes\n");
}
else
{
printf("no\n");
}
}
}
此程序运行时
输入111
打印结果为no
而输入222/333/444……时
打印结果为yes
求解