วันอาทิตย์ที่ 28 มิถุนายน พ.ศ. 2552

DTS02-23/06/2009

สรุปบทเรียน

การบ้าน

#include <stdio.h>

#include <string.h>


void main()


{

struct computer {

char name[50];

char model[50];

char processor[30];

float speed;

int hard;

char Graphic[50];

char Operating[20];

float weight;

char price[20];

};


struct computer notebook;

strcpy(notebook.name,"Apple");

strcpy(notebook.model,"MacBook Air");

strcpy(notebook.processor,"intel core 2 duo");

notebook.speed=2.13;

notebook.hard=128;

strcpy(notebook.Graphic,"nVidia GeForce 9400M GS");

strcpy(notebook.Operating,"Mac OS 10.5");

notebook.weight=1.36;

strcpy(notebook.price,"65007");




printf("**********NoteBook********\n\n");

printf(" Name:%s\n",notebook.name);

printf(" model:%s\n",notebook.model);

printf(" processor:%s\n",notebook.processor);

printf(" speed:%f GHz \n",notebook.speed);

printf(" hard disk:%d gb\n",notebook.hard);

printf(" Graphic system:%s\n",notebook.Graphic);

printf(" Operating System:%s\n",notebook.Operating);

printf(" weight:%f kg \n",notebook.weight);

printf(" price:%s\n",notebook.price);

}

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

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