ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1585. Penguins

Posted by DD 30 Oct 2007 10:30
/*            Name:D.cpp
Date:
Lang:Cpp
Environment:MS Visual Studio 2005 Sp1
*/

//               Defines
#define DEBUG 0

#define FILE_INPUT 1
#define FILE_OUTPUT 1

#define FILE_OUTPUT_NAME "D.out"
#define FILE_INPUT_NAME "D.in"

//               Includes
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include<string>
#include<iostream>
//               Namespace
using namespace std;
//               SETIO function
int setio()
{
//    seting input
#if FILE_INPUT
//    freopen(FILE_INPUT_NAME,"r",stdin);
#endif
//    seting output
#if FILE_OUTPUT
//    freopen(FILE_OUTPUT_NAME,"w",stdout);
#endif

//    Done,exiting
return 0;
}
//               Functions,Procedures,etc

//               Main function
int main()
{
#ifndef ONLINE_JUDGE
setio();
#endif

int n,i,a,b,c;string s;
a=0;b=0;c=0;s.clear();
cin>>n;
for(i=0;i<n;i++)
{cin>>s;
if (s[0]=='E')a++;
else if(s[0]=='M')b++;
else if(s[0]=='L')c++;
cin>>s;
}
if (a>b&&a>c) cout<<"Emperor Penguin"<<endl;
if (a<b&&b>c) cout<<"Macaroni Penguin"<<endl;
else cout<<"Little Penguin"<<endl;
//system("pause");
return 0;
}
#define FILE_OUTPUT_NAME "D.out"
#define FILE_INPUT_NAME "D.in"

for what is this pice of code???

Edited by author 07.12.2007 14:52