#include <iostream>#include <stdio.h>#include <conio.h>int main(){ char* S = new char[25]; cin >> S; bool en = false; for (int i = 0; i < strlen(S) - 1; i++) { for (int j = i + 1; j < strlen(S); j++) if (S[i] == S[j]) { cout << i + 1 << " = " << j + 1; en = true; break; } if (en) break; } getch(); return 0;}
#include <iostream>
#include <stdio.h>
#include <conio.h>
int main()
{
char* S = new char[25];
cin >> S;
bool en = false;
for (int i = 0; i < strlen(S) - 1; i++)
{
for (int j = i + 1; j < strlen(S); j++)
if (S[i] == S[j])
{
cout << i + 1 << " = " << j + 1;
en = true;
break;
}
if (en)
break;
}
getch();
return 0;
}