#include <stdio.h>
typedef struct main{
float weight;
char*model;
float maxspeed;
}Main;
typedef struct airplane{
float weight;
float maxspeed;
}Airplane;
typedef struct car{
float weight;
char*model;
float maxspeed;
}Car;
int comparefunction(void*a,void*b){
Main a1, a2;
a1=*(Main*)a;
a2=*(Main*)b;
return a1.weight-a2.weight;
}
int main(void) {
// your code goes here
Airplane a;
a.weight = 200;
Car c;
c.weight = 50;
printf("%d", comparefunction
((void*)&a
, (void*)&c
)); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgogdHlwZWRlZiBzdHJ1Y3QgbWFpbnsKICAgZmxvYXQgd2VpZ2h0OyAKICAgY2hhciptb2RlbDsgCiAgIGZsb2F0IG1heHNwZWVkOyAKfU1haW47CgoKdHlwZWRlZiBzdHJ1Y3QgYWlycGxhbmV7CiAgIGZsb2F0IHdlaWdodDsgCiAgIGZsb2F0IG1heHNwZWVkOyAKICB9QWlycGxhbmU7IAoKdHlwZWRlZiBzdHJ1Y3QgY2FyewogICBmbG9hdCB3ZWlnaHQ7CiAgIGNoYXIqbW9kZWw7ICAKICAgZmxvYXQgbWF4c3BlZWQ7ICAKfUNhcjsKCmludCBjb21wYXJlZnVuY3Rpb24odm9pZCphLHZvaWQqYil7CiAgIE1haW4gYTEsIGEyOyAKICAgYTE9KihNYWluKilhOyAgCiAgIGEyPSooTWFpbiopYjsgCgogICByZXR1cm4gYTEud2VpZ2h0LWEyLndlaWdodDsgCn0KCmludCBtYWluKHZvaWQpIHsKCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCUFpcnBsYW5lIGE7CglhLndlaWdodCA9IDIwMDsKCUNhciBjOwoJYy53ZWlnaHQgPSA1MDsKCXByaW50ZigiJWQiLCBjb21wYXJlZnVuY3Rpb24oKHZvaWQqKSZhLCAodm9pZCopJmMpKTsKCXJldHVybiAwOwp9Cg==