printf("姓名:%s\n",szBuf);printf("学号:%d\n",iNum);return0;} 代码具有较好的可移植性 C语言是面向过程的编程语言,用户只需要关注所被解决问题的本身,而不需要花费过多的精力去了解相关硬件,且针对不同的硬件环境,在用C语言实现相同功能时的代码基本一致,不需或仅需进行少量改动...
c语言:用结构体变量输出学生的信息,包括学号,姓名,性别。 用结构体变量输出学生的信息,包括学号,姓名,性别。 解:程序: #include<stdio.h> int main() { struct Student { long int num; char name[20]; char sex[5]; char addr[20]; }a = {1010,"yaoyao","Man","xi'an"};//定义结构体变量a并...
include <stdio.h> include <string.h> int main(int argc, char *argv[]){ char name[32] = {0};printf("Enter your name\n");scanf("%s", name);char sn[32] = {0};printf("Enter your student number\n");scanf("%s", sn);char class[32] = {0};printf("Enter your cla...
printf("学号:123456789 \t姓名:张三");} 很简单,就两个输出语句,\n意思就是换行,\t是空8个字符的位置
int clas[3];int old[3];} stu[5];void main(){int i;for(i=0;i<5;i++){ printf("\n please input No. %d score:\n",i);printf("stuNo:");scanf("%s",stu[i].num);printf("name:");scanf("%s",stu[i].name);printf("class:");scanf("%s",stu[i].clas);printf(...
include "stdio.h"void main(void){ printf("? \n");printf(" ?\n");printf(" ?\n");} 把?的地方换成你要输出的东西就行了
用c语言链表编写一个学生信息系统程序,要求输出学生的学号,姓名,性别,还有三门课比如语,数,外的成绩 / //FileName: stuinfo.c include <stdio.h> include <stdlib.h> include <string.h> define SERIALLEN 20 define COURSENUM 3 typedef struct { char course[SERIALLEN];float score;}_...
int num;int score;}STU;void main(){ STU student[10];int pass=60,j,i;printf("输入学生的信息,每输入一个名字和学号之后按空格,输入一个成绩之后按回车:\n");for(j=0;j<10;j++)scanf("%s %d %d",&student[j].name,&student[j].num,&student[j].score);printf(" name n...
printf("姓名为%s,学号为%s,分数为%d。\n",Name,ID,Grade);} }Student;//类student定义结束 void main(){ Student s_1("a","2012302590014",54);//实例化一个student对象,名为s_1,其名字为a,id为2012302590014,分数为54。下面类似 Student s_2("b","2012302590081",95);Student s_3(...
// 33333333.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <stdio.h>#include <stdlib.h>#include <string.h>struct student {char stuNum[20]; //学生学号char stuName[20]; //学生姓名float stuscore[3]; //学生3门课成绩float...