#include <stdio.h>
struct student_data{
int num, h, w;
};
int main(){
struct student_data *p[10];
int i, a=0, b=0, c=0, d=0;
printf("Input student number, height, weight:");
for(i=0;;i++){
scanf("%d %d %d", p[i]->num, p[i]->h, p[i]->w);
if(p[i]->num<0){
break;
}else if(i>=1){
if(p[i]->h-a->h>0){
p[i]->a;
}else{
p[i]->a;
}
}
}
for(i=0;;i++){
if(i>=1){
if(p[i]->h-c->h<0){
p[i]->c;
}else{
p[i]->c;
}
}
}
for(i=0;;i++){
if(i>=1){
if((p[i]->h)-(b->h)<0){
p[i]->b;
}else{
p[i]->b;
}
}
}
for(i=0;;i++){
if(i>=1){
if(p[i]->w-d->w<0){
p[i]->d;
}
}else{
p[i]->d;
}
}
printf("Tallest student number is %d (%d)\n", a.num, a.h);
return 0;
}
#include <stdio.h>
struct student_data{
int num, h, w;
};
int main(){
struct student_data *p[10];
int i, a=0, b=0, c=0, d=0;
printf("Input student number, height, weight:");
for(i=0;;i++){
scanf("%d %d %d", p[i]->num, p[i]->h, p[i]->w);
if(p[i]->num<0){
break;
}else if(i>=1){
if(p[i]->h-a->h>0){
p[i]->a;
}else{
p[i]->a;
}
}
}
for(i=0;;i++){
if(i>=1){
if(p[i]->h-c->h<0){
p[i]->c;
}else{
p[i]->c;
}
}
}
for(i=0;;i++){
if(i>=1){
if((p[i]->h)-(b->h)<0){
p[i]->b;
}else{
p[i]->b;
}
}
}
for(i=0;;i++){
if(i>=1){
if(p[i]->w-d->w<0){
p[i]->d;
}
}else{
p[i]->d;
}
}
printf("Tallest student number is %d (%d)\n", a.num, a.h);
return 0;
}