#include <iostream>
using namespace std;
void checkAnswers(string my, string right);
int main()
{
string right_answers = "abcacabbb";
string my_answers;
cout << "Please, enter all the " << right_answers.size() << " answers in one string!" << endl;
cin >> my_answers;
checkAnswers(my_answers, right_answers);
return 0;
}
void checkAnswers(string my, string right)
{
int i, counter = 0;
int num = right.size();
for(i = 0; i < num; i++)
{
if(my[i] != right[i])
counter++;
}
if(counter == 0)
cout << "All is right! Good job!";
else
cout << "You have made " << counter << " mistakes. Please, try again!";
}
Comments
Leave a comment