摘要: #include<stdio.h>#include<stdlib.h>#include<string.h> //写函数void writetext(FILE *fw){ char str[80]; gets(str); while(strcmp(str,"-1")!=0) { fputs(str,f 阅读全文
posted @ 2022-05-12 11:41 -Qiqiqiiklki 阅读(78) 评论(0) 推荐(0)
摘要: //该程序完成“动态内存分配” #include <stdio.h>#include <stdlib.h> typedef struct node //结构体,有两个分量,一个是数据,另一个是指针{ int data; struct node *next;}linklist; //主菜单int me 阅读全文
posted @ 2022-05-06 19:58 -Qiqiqiiklki 阅读(111) 评论(0) 推荐(0)
摘要: //该程序完成“动态内存分配” #include <stdio.h>#include <stdlib.h> typedef struct node //结构体,有两个分量,一个是数据,另一个是指针{ int data; struct node *next;}linklist; //主菜单void m 阅读全文
posted @ 2022-04-28 15:28 -Qiqiqiiklki 阅读(80) 评论(0) 推荐(0)
摘要: //编写一个函数print,输出学生的信息,该数组有5个学生的记录,包括://num,sname,score[3],用主函数输入这些记录,用print函数输出这些记录。 #include<stdio.h>#define N 5 //预定义,N代表5个学生 struct student{ int nu 阅读全文
posted @ 2022-04-21 12:37 -Qiqiqiiklki 阅读(89) 评论(0) 推荐(0)
摘要: #include <stdio.h>#include <string.h>#define N 5 struct student //数据类型{ int num; //学号 char sname[25]; //姓名 char sex[4]; //性别 int age; //年龄}; struct st 阅读全文
posted @ 2022-04-14 12:15 -Qiqiqiiklki 阅读(134) 评论(0) 推荐(0)
摘要: #include<stdio.h>#include<stdlib.h>//输出4个学生5门成绩 int print(int m[4][5]){ int i,j; for(i=0;i<4;i++)//行 { for(j=0;j<5;j++)//列 { printf("%3d",m[i][j]); } 阅读全文
posted @ 2022-04-07 20:17 -Qiqiqiiklki 阅读(69) 评论(0) 推荐(0)
摘要: #include <stdio.h>void main(){ int array[10]; int *pointer; int i,j,t,max,min,sum=0; double aver; int num1=0,num2=0; pointer=array; //指针指向数组,数组名表示数组的首 阅读全文
posted @ 2022-03-24 11:39 -Qiqiqiiklki 阅读(242) 评论(1) 推荐(0)
摘要: C语言 指针 源代码: #include <stdio.h>void main(){ int array[10]; int *pointer; int i; pointer=array; //指针指向数组,数组名表示数组的首地址 printf("请输入10个数:"); for(i=0;i<10;i++) scan 阅读全文
posted @ 2022-03-24 10:47 -Qiqiqiiklki 阅读(74) 评论(0) 推荐(0)
摘要: 源代码: #include<stdio.h>#include<stdlib.h>int main(){ int x=8; int *p; //指针变量前面加一个* p=&x; //p是地址,&x是地址;指针即是地址 printf("%d",x); printf("\n"); //换行 printf( 阅读全文
posted @ 2022-03-17 11:55 -Qiqiqiiklki 阅读(75) 评论(0) 推荐(0)
摘要: 源代码: #include <stdio.h>#include <stdlib.h> #define N 5 //函数与指针混合编程 void swap(int *pointer1, int *pointer2){ int temp; temp = *pointer1; *pointer1 = *p 阅读全文
posted @ 2022-03-17 11:50 -Qiqiqiiklki 阅读(73) 评论(0) 推荐(0)