Skip to content

Instantly share code, notes, and snippets.

@shohan4556
Created February 1, 2015 05:29
Show Gist options
  • Select an option

  • Save shohan4556/3b10d59ed8a21bad0f7e to your computer and use it in GitHub Desktop.

Select an option

Save shohan4556/3b10d59ed8a21bad0f7e to your computer and use it in GitHub Desktop.
URI -- 1555 (Functions)
/// Author : Md.Shohanur Rahaman
/// URI -- 1555 (Functions)
#include<stdio.h>
#include<math.h>
int main()
{
int long long x,y,rafa,beto,carl,test,i;
while(scanf("%lld",&test)==1){
for(i=1;i<=test;i++){
scanf("%lld %lld",&x,&y);
rafa=pow((3*x),2)+pow(y,2);
beto=2*pow(x,2)+pow((5*y),2);
carl=-100*x+(pow(y,3));
if(rafa>beto && rafa>carl)
printf("Rafael ganhou\n");
else if(beto>rafa && beto>carl)
printf("Beto ganhou\n");
else
printf("Carlos ganhou\n");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment