摘要: //test4.c #include<stdio.h> int main() { char ch; int i; int count= 0 ; FILE *fp; fp = fopen("data4.txt", "r"); if(fp == NULL) { printf("fail to open 阅读全文
posted @ 2023-06-08 22:23 lenmoye 阅读(18) 评论(0) 推荐(0) 编辑
摘要: test4.c#include <stdio.h> #include<string.h> #define N 100 typedef struct { char num[10]; // 学号 int s1; // 期末成绩 int s2; // 平时成绩 double sum; // 总评 char 阅读全文
posted @ 2023-06-01 09:09 lenmoye 阅读(6) 评论(0) 推荐(0) 编辑
摘要: //5.4test1_1.c#include <stdio.h> #define N 4 int main() { int x[N] = {1,9,8,4}; int i; int *p; //方式1:通过数组名和下标遍历输出数组元素 for (i = 0;i < N; ++i) printf("% 阅读全文
posted @ 2023-05-11 15:30 lenmoye 阅读(4) 评论(0) 推荐(0) 编辑
摘要: //task1_1.c #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",s 阅读全文
posted @ 2023-04-20 02:17 lenmoye 阅读(8) 评论(0) 推荐(0) 编辑
摘要: //task1.c #include <stdio.h> #include <stdlib.h> #include <time.h> #include <windows.h> #define N 80 void print_text(int line, int col, char text[]); 阅读全文
posted @ 2023-04-05 23:59 lenmoye 阅读(9) 评论(0) 推荐(0) 编辑
摘要: //test1.c #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 #define R1 586 #define R2 701 int main() { int number; int i; srand( ti 阅读全文
posted @ 2023-03-18 15:49 lenmoye 阅读(15) 评论(0) 推荐(0) 编辑
摘要: /打印一个小人 #include <stdio.h> int main() { printf(" o \n"); printf("<H>\n"); printf("I I\n"); return 0; } //1+2+3+…+n(设n的取值在100以内) //用数学归纳法(求和公式计算) #incl 阅读全文
posted @ 2023-03-09 00:24 lenmoye 阅读(23) 评论(1) 推荐(0) 编辑