91学习

陪伴你每一天!

定义一个表示汽车的结构体

#include <stdio.h>


#include <string.h>


struct car{

char name[64];

char color[20];

float length;

int seniority;

};

int main(){

struct  car a_car;

strcpy(a_car.name,"路虎");

strcpy(a_car.color,"黑色");

a_car.length=4.85f;

a_car.seniority=5;

printf("车牌名:%s\n",a_car.name);

printf("颜色是:%s\n",a_car.color);

printf("车长:%f米\n",a_car.length);

printf("可承载%d人\n",a_car.seniority);

return 0;

}

加威信18790284560免费送POS机.jpg

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。