摘要: // 将图书信息写入文本文件data1.txt #include <stdio.h> #define N 7 #define M 80 typedef struct { char name[M]; // 书名 char author[M]; // 作者 } Book; int main() { Bo 阅读全文
posted @ 2023-06-16 09:35 微笑王子 阅读(5) 评论(0) 推荐(0) 编辑
摘要: // P286例8.17 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include <stdio.h> #include <string.h> #define N 10 // 运行程序输入测试时,可以把这个数组改小一些输 阅读全文
posted @ 2023-05-29 19:50 微笑王子 阅读(4) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #define N 4 int main(){ int x[N]={1,9,8,4}; int i; int *p; for(i=0;i<N;i++){ printf("%d",x[i]); } printf("\n"); for(p=x;p<x+N;++p){ 阅读全文
posted @ 2023-05-08 21:55 微笑王子 阅读(6) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #define N 4 int main() { int a[N] = {2, 0, 2, 3}; char b[N] = {'2', '0', '2', '3'};//四个字符占一个字节 int i; printf("sizeof(int) = %d\n", 阅读全文
posted @ 2023-04-19 22:25 微笑王子 阅读(21) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> #include <time.h> #include <windows.h> #define N 80 void print_text(int line, int col, char text[]); // 函数声明 vo 阅读全文
posted @ 2023-04-02 17:43 微笑王子 阅读(16) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<math.h> #include<stdlib.h> #include<time.h> int main() { char n; while(n!=EOF) { n=getchar(); getchar(); switch(n) { case ' 阅读全文
posted @ 2023-03-22 22:04 微笑王子 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 试验任务一#include<stdio.h> #include<stdlib.h> int main() { printf("o \n"); printf("<H>\n"); printf("I I\n"); system("pause"); return 0; } 试验任务2#include<st 阅读全文
posted @ 2023-03-08 21:43 微笑王子 阅读(21) 评论(0) 推荐(0) 编辑