摘要:
实验任务1:使用指针变量间接访问一维数组元素 #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(" 阅读全文
摘要:
实验任务1:文本文件数据格式化读写 (1) // 将图书信息写入文本文件data1.txt #include <stdio.h> #define N 5 #define M 80 typedef struct { char name[M]; // 书名 char author[M]; // 作者 } 阅读全文
摘要:
task1-1.c #include<stdio.h> #define N 4 int main() { int a[N] = {2, 0, 2, 2}; char b[N] ={'2','0','2','2'}; int i; printf("sizeof(int) = %d\n",sizeof( 阅读全文
摘要:
实验任务1 #include<stdio.h> #include<stdlib.h> #include<time.h> #include<windows.h> #define N 80 void printfText(int line,int col,char text[]);//函数声明 void 阅读全文
摘要:
#include<stdio.h> #include<stdlib.h> #include<time.h> #define N 5 int main() { int grade,number; int i; srand(time(0));//以当前系统时间作为随机种子 for(i=0;i<N;++i 阅读全文
摘要:
// 打印一个字符小人 #include<stdio.h> int main() { printf("O\n"); printf("<H>\n"); printf("I I\n"); return 0; } // 打印垂直字符小人 #include<stdio.h> int main() { pri 阅读全文