摘要: #include<stdio.h> #include<stdlib.h> int main(){ FILE *fp; char al; int count=0; fp=fopen("C:\\date4.txt","r"); if(fp==NULL){ printf("fail to open fil 阅读全文
posted @ 2022-12-25 22:12 吱吱1号 阅读(10) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include<string.h> #include<stdlib.h> #define N 100 typedef struct { char num[10]; // 学号 int s1; // 期末成绩 int s2; // 平时成绩 double sum 阅读全文
posted @ 2022-12-25 21:24 吱吱1号 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 1.1 是 4 是 1一样#include <stdio.h> #define N 4 int main() {int a[N] = {1, 9, 8, 4}; char b[N] = {'1', '9', '8', '4'}; int i; printf("sizeof(int) = %d\n", 阅读全文
posted @ 2022-11-23 19:51 吱吱1号 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 实验1.1 随机打印hi,november#include <stdio.h> #include <stdlib.h> #include <time.h> #include <windows.h> #define N 80 void print_text(int line, int col, cha 阅读全文
posted @ 2022-11-06 15:46 吱吱1号 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 实验1rand():1.不需要参数,返回一个从0到最大随机数的任意整数2.0~99 rand()%100 1~100 rand()%100+1 即 rand()%n+a a是起始值,n-1+a是终止值,n是整数的范围3.通常rand()产生的随机数在每次运行的时候都与上一次相同,若要产生每次不同的随 阅读全文
posted @ 2022-10-22 16:07 吱吱1号 阅读(15) 评论(0) 推荐(1) 编辑
摘要: 实验7 关于getchar()总结 1.小黑窗一闪而过,在末尾加getchar(),让程序不会立刻退出,即让程序停留在这一步,直到他从键盘上接受到消息。 2.在两次连续输入的程序中间加getchar()【感觉一般是数字和字符之间】,当从键盘输入时,输入的字符会被保存在缓冲区,当键盘按下enter时, 阅读全文
posted @ 2022-10-12 09:08 吱吱1号 阅读(49) 评论(0) 推荐(0) 编辑