Блог пользователя Killever

Автор Killever, 13 лет назад, По-английски
i'm one of real madrid fans :) 
i run this algorithm on the last match the result was "Draw"
so i think my algorithm is true :)

#include<barcelona >
#include<real madrid >

using namespace std;

string getResult(vector<string> barcelona, vector<string> realmadrid)
    {
    try
{
if (((barcelona).find("messi") != (barcelona).end()))
   {
   return "barcelona";
   }
else
   {
   return "barcelona";
   }
}
    catch (Exception e)
{
cout << "Draw" << endl;
}
    return "realmadrid";
    }
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
It looks ugly that one of results is printed to cout while two others are "returned".
And by the way since players could be sold and bought freely, I suppose that algorithm should be symmetrical (just for some possible future occasions).

Also it is fun that "Draw" is capitalized while "messi", "barcelona" and "realmadrid" are not...
13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
I think all negatives for previous post from  real madrid fans but i told you i'm one of real madrid fans but i tell the truth  :)