Something
public text v1 · immutable#include <iostream>
#include <string>
using namespace std;
int optimizacija(string s, string &t);
int _tmain(int argc, char * argv[])
{
string s = "<><";
string opt;
//optimizacija(s,opt);
cout << opt; // don't work
cout << "hello" << endl; // don't work
cin.get();
return 0;
}
int optimizacija(string s, string &t)
{
int i=0, j=0;
char c;
t = "";
while (i < s.size())
{
c = s[i];
j=i;
while (s[i] == s[++j])
i = j;
t += s[i];
i++;
}
return 0;