摘要: // 将图书信息写入文本文件data1.txt // 再从文件中读取图书信息,打印输出到屏幕上,并显示行号 #include <stdio.h> #define N 80 #define M 100 typedef struct { char name[N]; // 书名 char author[N 阅读全文
posted @ 2024-06-18 20:20 张颖雯 阅读(19) 评论(0) 推荐(0)
摘要: // P286例8.17 // 对教材上的程序作了微调整,把输出学生信息单独编写成一个函数模块 // 打印不及格学生信息和所有学生信息程分别调用 #include <stdio.h> #include <string.h> #define N 3 // 运行程序输入测试时,可以把这个数组改小一些输入 阅读全文
posted @ 2024-06-03 23:22 张颖雯 阅读(28) 评论(0) 推荐(0)
摘要: #include <stdio.h> #define N 80 void encoder(char *str); // 函数声明 void decoder(char *str); // 函数声明 int main() { char words[N]; printf("输入英文文本: "); gets 阅读全文
posted @ 2024-05-20 23:01 张颖雯 阅读(31) 评论(0) 推荐(0)
摘要: #include <stdio.h> #define N 4 void test1() { int a[N] = {1, 9, 8, 4}; int i; // 输出数组a占用的内存字节数 printf("sizeof(a) = %d\n", sizeof(a)); // 输出int类型数组a中每个 阅读全文
posted @ 2024-05-15 23:35 张颖雯 阅读(32) 评论(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 @ 2024-04-22 23:41 张颖雯 阅读(14) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> #include<time.h> #define N 5 int main() { int number; int i; srand(time(0)); for(i=0;i<N;++i) { number=rand()%65+ 阅读全文
posted @ 2024-04-10 22:36 张颖雯 阅读(12) 评论(0) 推荐(0)
摘要: #include<stdio.h> int main() { printf(" o\n"); printf("<H>\n"); printf("I I\n"); printf(" o\n"); printf("<H>\n"); printf("I I\n"); return 0; } #includ 阅读全文
posted @ 2024-03-13 23:39 张颖雯 阅读(45) 评论(2) 推荐(2)