Write a program to ask the user to input the name of boy and name of girl. Count the number of common letters to their names and add them up. Determine the corresponding equivalent using the games FLAMES. (F = riends, L = Lovers, A = Angry, M = arriage , E = Enemies, S = Sweet)
1
Expert's answer
2013-03-27T09:07:17-0400
#include <iostream> #include <string> using namespace std;
int main(){ string _flames[] = {"Friends", "Lovers", "Angry", "Marriage", "Enemies", "Sweet"}; string _boy, _girl; int _common = 0; cout<<"Input the name of boy:"; cin>>_boy; cout<<"Input the name of girl:"; cin>>_girl; & for ( int i = 0; i < _girl.length(); i++ ) & { & _common += count(_boy.begin(), _boy.end(), _girl[i]); & } cout<<_flames[_common%6]<<endl; return 0; }
Comments
Leave a comment