摘要:
1.实验任务1:使用指针变量间接访问一维数组元素 task1_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 阅读全文
摘要:
1.实验任务1:文本文件数据格式化读写 task1_1.c // 将图书信息写入文本文件datal.txt #include<stdio.h> #define N 5 #define M 80 typedef struct { char name[M]; //书名 char author[M]; / 阅读全文
摘要:
1.实验任务1 task1_1.c #include <stdio.h> #define N 4 int main() { int a[N] = {2,0,2,2}; char b[N] = {'2', 'O','2','2'}; int i; printf("sizeof(int) = %d\n" 阅读全文
摘要:
#include <stdio.h> #include <stdlib.h> #include <time.h> #include <windows.h> #define N 80 void printText(int line, int col, char text[]); void printS 阅读全文
摘要:
1.实验任务1 task1.c //随机产生5组在校学生学号 #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 int main() { int grade, number; int i; srand(time( 阅读全文
摘要:
四、实验结论 1.实验任务1 task1_1.c // 在垂直方向上打印两个字符小人 #include <stdio.h> int main() { printf(" O \n"); printf("<H>\n"); printf("I I\n"); printf("\n"); printf(" O 阅读全文