我有我的以下代码,其中对于唯一检查部分我给出的任何输入都是唯一字符。在案例 2 中,我在逻辑上遗漏了什么吗?
***case 2: {
{
for(int i=0;i<counter;i++)
for(int j=1;j<counter;j++) //I THINK THIS US WHERE SOME THING WENT WRONG
{ // LOGICALLY. WHAT IS THAT THAT HAS TO BE
//CHANGED.
if(array[i] == array[j]) { flag == 1; }
else flag = 0;
}
}
if(flag == 1) { cout<<"\n All characters in the sentence are not unique"; }
else if(flag == 0) { cout<<"All are unique characters"; }
};break;***
}