摘要: 1 #include <stdio.h> 2 #define N 5 3 // 定义结构体类型struct student,并定义STU为其别名 4 typedef struct student 5 { 6 long no; 7 char name[20]; 8 int score; 9 } STU 阅读全文
posted @ 2021-12-27 17:53 李思齐 阅读(32) 评论(1) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #define N 5 3 int binarySearch(int *x, int n, int item); // 函数声明 4 int main() 5 { 6 int a[N] = {2, 7, 19, 45, 66}; 7 int i, ind 阅读全文
posted @ 2021-12-15 11:28 李思齐 阅读(35) 评论(1) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #define N 5 3 void output(int x[], int n); 4 int main() 5 { 6 int x[N] = {9, 55, 30, 27, 22}; 7 int i; 8 int k; 9 int t; 10 pri 阅读全文
posted @ 2021-12-12 17:03 李思齐 阅读(25) 评论(1) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 const int N = 4; 4 int main(){ 5 int a[N]={2,0,2,1}; 6 char b[N]={'2','0','2','1'}; 7 int i; 8 printf("size 阅读全文
posted @ 2021-12-01 19:56 李思齐 阅读(26) 评论(1) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 long long fac(int n); 4 //利用局部变量static的特性,计算阶乘 5 int main(){ 6 int i,n; 7 printf("Enter n:"); 8 scanf("%d", 阅读全文
posted @ 2021-11-24 20:17 李思齐 阅读(48) 评论(3) 推荐(0) 编辑
摘要: 实验1中控制符%04d可以在数字左侧填充0,实现右侧对齐 //格式化输入、输出函数的简单运用 #include<stdio.h> #include<stdlib.h> int main(){ int num; scanf ("%d",&num); printf ("2049%04d\n",nun) 阅读全文
posted @ 2021-11-11 20:13 李思齐 阅读(31) 评论(2) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2021-10-27 20:21 李思齐 阅读(14) 评论(0) 推荐(0) 编辑