Problem: 1131 - Grenais
Solution:
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a, b, t=1, inter=0, grenais=0, draw=0;
while(1)
{
int m=0;
loop:
cin>>a>>b;
if(a>b)
inter++;
else if(a==b)
draw++;
else
grenais++;
cout<<"Novo grenal (1-sim 2-nao)"<<endl;
cin>>m;
if(m==1)
{
t++;
goto loop;
}
else if(m==2)
break;
}
cout<<t<<" grenais"<<endl;
cout<<"Inter:"<<inter<<endl;
cout<<"Gremio:"<<grenais<<endl;
cout<<"Empates:"<<draw<<endl;
if(inter>grenais)
cout<<"Inter venceu mais"<<endl;
else if(inter==grenais)
cout<<"Gremio venceu mais"<<endl;
else
cout<<"Não houve vencedor"<<endl;
return 0;
}
Maruf
No comments yet. Be the first to comment!