学生信息表

// student.cpp : 定义控制台应用程序的入口点。
//
#include"stdafx.h"
#include<stdio.h>
#include<string.h>
struct student
{
    char name[20];
    int age;
    char sex;
    int nomber;
    float score;
    char telephone[100];
};
int main()
{   
    struct student stu1;
    strcpy(stu1.name,"杨文杰");
    strcpy(stu1.telephone,"15025498663");
    stu1.age=21;
    stu1.nomber=12;
    stu1.score=98;
    stu1.sex='M';
    printf("姓名:%s\t性别:%c\t年龄:%d\t学号:%d\t成绩:%1.2f\t电话:%s\n",stu1.name,stu1.sex,stu1.age,stu1.nomber,stu1.score,stu1.telephone);
}

原文地址:https://www.cnblogs.com/ywj2013/p/3111866.html