วันอังคารที่ 30 มิถุนายน พ.ศ. 2552

#include
#include
int main(void)
{
struct car{
char brand[30];
char Engine[30];
char CylinderCapacity[30];
int MaxPower;
int MaxTorque;
float PowerRatio;
char Transmission[30];
char color[30];
char GearBox[30];
int Length;
int Width;
int weight;
int Height;
float controlMotronic;
int price;
}product;
strcpy(product.brand,"FERRARI SPIDER");
strcpy(product.Engine,"V8 DrySump");
strcpy(product.CylinderCapacity,"3586 cc ");
product.MaxPower = 400;
product.MaxTorque = 38;
product.PowerRatio = 3.6;
strcpy(product.Transmission,"MR");
strcpy(product.color,"Black");
strcpy(product.GearBox,"6 Speed");
product.Length = 4477;
product.Width = 1922;
product.weight = 1350;
product.Height = 1235;
product.controlMotronic = 7.3 ;
product.price = 24000000;

printf("\n Brand;%s\n Engine;%s\n CylinderCapacity;%s\n MaxPower;%d\n MaxTorque;%d\n PowerRatio;%.1f\n Transmission;%s\n Color;%s\n earBox;%s\n Length;%d\n Width;%d\n weight;%d\n Height;%d\n ControlMotronic;%.1f\n price;%d\n",
product.brand,product.Engine,product.CylinderCapacity,product.MaxPower,product.MaxTorque,product.PowerRatio,product.
Transmission,product.color,product.GearBox,product.Length,product.Width,product.weight,product.Height,product.controlMotronic,product.price,product);
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น