Originally Posted by
quzah
What part are you having problems with? Show your attempt, any errors you get, and specifically what you can or cannot figure out.
Quzah.
Hi quzah thanks for the reply.
Here is what i did.. but when i compare the team name.. it doesnt work. and i dont know how to approach the 3rd portion
Code:
#include <stdio.h>
#include <string.h>
struct icpc{
char team[8];
char insitution[8];
char coach[8];
char c1[8];
char c2[8];
char c3[8];
int solved, penalty;
};
int main()
{
struct icpc t1 = {"NUSSOC1","NUS","Steven","Victor","Adhiraj","Hung", 4, 448}, t2 = {"NUSSOC2","NUS","Steven","Duc","Tien","Phong", 6, 716}, t3 = {"NUSSOC3","NUS","Steven","Haocong","BiRan","Daniel", 5, 755};
if(t1.solved>t2.solved && t1.solved>t3.solved)
printf("Team 1 is rank 1.\n");
if(t2.solved>t1.solved && t2.solved>t3.solved)
printf("Team 2 is rank 1.\n");
if(t3.solved>t1.solved && t3.solved>t2.solved)
printf("Team 3 is rank 1.\n");
if(t1.team == "NUSSOC1"){
printf("%s\n",t1.coach);
printf("12345\n");
}
if(t2.team == "NUSSOC1")
printf("%s\n",t2.coach);
if(t2.team == "NUSSOC1")
printf("%s\n",t3.coach);
}