0
What's an error with my code?
3 Antworten
+ 1
Nothings Wrong....
+ 1
Change your code like this↓
#include<iostream>
using namespace std;
int main()
{
string str;
int i=0,j,a=0;
getline(cin,str);
int x=str.size();
for(;i<x;i++)
{
char first=str[i];
for(j=i+1;j<x;j++)
{
char second=str[j];
if(first==second)
a+=1;
}
}
if(a>=1)
cout<<"DejaVu";
else
cout<<"Unique";
//cout<<z;
return 0;
}
In your code you didn't add string length .