#include <stdio.h>
struct Device {
char name[100];
int price;
int quantity;
};
void printDevice(struct Device device) {
printf("%s\t%d\t\t%d\n", device.
name, device.
price, device.
quantity); }
int main() {
struct Device devices[] = {
{"CPU_INTEL_CORE_I5_10400F", 5490, 1},
{"ASROCK_B460M_PRO_4", 3050, 1},
};
int numDevices = sizeof(devices) / sizeof(devices[0]);
printf("Device\tPrice/device\tNumber of devices\n"); for (int i = 0; i < numDevices; i++) {
printDevice(devices[i]);
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgpzdHJ1Y3QgRGV2aWNlIHsKICAgIGNoYXIgbmFtZVsxMDBdOwogICAgaW50IHByaWNlOwogICAgaW50IHF1YW50aXR5Owp9OwoKdm9pZCBwcmludERldmljZShzdHJ1Y3QgRGV2aWNlIGRldmljZSkgewogICAgcHJpbnRmKCIlc1x0JWRcdFx0JWRcbiIsIGRldmljZS5uYW1lLCBkZXZpY2UucHJpY2UsIGRldmljZS5xdWFudGl0eSk7Cn0KCmludCBtYWluKCkgewogICAgc3RydWN0IERldmljZSBkZXZpY2VzW10gPSB7CiAgICAgICAgeyJDUFVfSU5URUxfQ09SRV9JNV8xMDQwMEYiLCA1NDkwLCAxfSwKICAgICAgICB7IkFTUk9DS19CNDYwTV9QUk9fNCIsIDMwNTAsIDF9LAogICAgICAgIAogICAgfTsKICAgIGludCBudW1EZXZpY2VzID0gc2l6ZW9mKGRldmljZXMpIC8gc2l6ZW9mKGRldmljZXNbMF0pOwoKICAgIHByaW50ZigiRGV2aWNlXHRQcmljZS9kZXZpY2VcdE51bWJlciBvZiBkZXZpY2VzXG4iKTsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtRGV2aWNlczsgaSsrKSB7CiAgICAgICAgcHJpbnREZXZpY2UoZGV2aWNlc1tpXSk7CiAgICB9CgogICAgcmV0dXJuIDA7Cn0=