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

DTS 02-23/06/2009

#include "stdio.h"
#include "string.h"
void main()
{
struct Telephone
{
char brand[20];
char model[30];
char type[20];
char camera [30];
int code_member;
char color[15];
float price;
float discount;
}sale;
strcpy(sale.brand,"Nokia");
strcpy(sale.model,"5310 Xpress Music");
strcpy(sale.type,"Telephone");
strcpy(sale. camera," 2 million pixels");
sale.code_member=12234;
strcpy(sale.color,"black");
sale.price=9460;
sale.discount=450;
printf("Brand:%s\n",sale.brand);
printf("Model:%s\n",sale.model);
printf("Type:%s\n",sale.type);
printf("Camera:%s\n",sale.camera);
printf("Code_Member:%d\n",sale.code_member);
printf("Color:%s\n",sale.color);
printf("Price:%.2f\n",sale.price);
printf("Discount:%.2f\n",sale.discount);
}




สิ่งที่จากการเรียนวิชาโครงสร้างข้อมูล คือ ได้เรียนรู้และทราบถึงชนิดของข้อมูล และโครงสร้างข้อมูล และยังได้ทบทวบเกี่ยวกับภาษาซี

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

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