"Основи на програмирането със C++"/Глава 9.1 Задача: пет специални букви
https://cpp-book.softuni.bg/chapter-09-problems-for-champions.html
Изписва ми следната грешка:
Process terminated with status -1073741510 (0 minute(s), 6 second(s))
Къде греша?
int startNum, endNum;
cin>>startNum>>endNum;
int counter=0;
for (int l1=0; l1<5; l1++){
for (int l2=0; l2<5; l2++){
for (int l3=0; l3<5; l3++){
for (int l4=0; l4<5; l4++){
for (int l5=0; l5<5; l5++){
string letters="abcde";
string fullWord;
fullWord+=letters[l1];
fullWord+=letters[l2];
fullWord+=letters[l3];
fullWord+=letters[l4];
fullWord+=letters[l5];
string weightWord;
weightWord+=fullWord[0];
for (int i=1; i<=fullWord.size(); i++){
for (int j=0; j<=weightWord.size(); j++){
if (weightWord[j]!=fullWord[i]){
weightWord+=fullWord[i];
}
}
}
int weight=0;
for (int i=0; i<weightWord.size(); i++){
int multiplier=0;
switch (weightWord[i]){
case 'a':
multiplier=5;
break;
case 'b':
multiplier=-12;
break;
case 'c':
multiplier=47;
break;
case 'd':
multiplier=7;
break;
case 'e':
multiplier=-32;
break;
}
weight+=multiplier*(i+1);
}
if (startNum<=weight&&endNum>=weight){
cout<<fullWord<<" ";
counter++;
}
}
}
}
}
}
cout<<endl;
if (counter==0){
cout<<"No"<<endl;
}