2021年12月23日

摘要: /7.1/ 1 #include <stdio.h> 2 3 #define N 2 4 5 // 定义结构体类型struct student,并定义STU为其别名 6 typedef struct student 7 { 8 long no; 9 char name[20]; 10 int sco 阅读全文
posted @ 2021-12-23 22:53 BS--HARD 阅读(61) 评论(1) 推荐(0) 编辑

2021年12月15日

摘要: /6.1/ #include <stdio.h> #define N 5 int binarySearch(int *x, int n, int item); // 函数声明 int main() { int a[N] = {2, 7, 19, 45, 66}; int i, index, key; 阅读全文
posted @ 2021-12-15 11:14 BS--HARD 阅读(96) 评论(0) 推荐(0) 编辑

2021年12月9日

摘要: /5.1.1/ 1 #include<stdio.h> 2 #define N 5 3 void output(int x[],int n); 4 int main(){ 5 int x[N] = {9,55,30,27,22}; 6 int i,t,k; 7 8 printf("original 阅读全文
posted @ 2021-12-09 22:58 BS--HARD 阅读(48) 评论(0) 推荐(0) 编辑

2021年12月1日

摘要: /4.1/ #include<stdio.h> int main(){ int a[2][3] = {{1,2,3},{4,5,6}}; char b[2][3] = {{'1','2','3'},{'4','5','6'}}; int i,j; for(i = 0;i < 2; ++i) for( 阅读全文
posted @ 2021-12-01 15:26 BS--HARD 阅读(38) 评论(0) 推荐(0) 编辑

2021年11月27日

摘要: /1.1.1/ #include<stdio.h>long long fac(int n);int main(){ int i,n; printf("Enter n:"); scanf("%d",&n); for(i = 1;i <= n;++i) printf("%d! = %11d\n",i,f 阅读全文
posted @ 2021-11-27 20:13 BS--HARD 阅读(41) 评论(2) 推荐(0) 编辑

2021年11月13日

摘要: /2.1/ #include<stdio.h>int main(){ int num,i = 0; while(i<3){ scanf("%d",&num); printf("2049%04d\n",num);} } /*%04所起的作用是输出的数据宽度为四,且右对齐,不够的用0补齐。*/ /2.2 阅读全文
posted @ 2021-11-13 13:05 BS--HARD 阅读(86) 评论(1) 推荐(0) 编辑

2021年10月27日

摘要: /1.1/ #include<stdio.h> int main(){ printf(" O \n"); printf("<H>\n"); printf("I I\n"); return 0; } /1.2/ #include<stdio.h>int main(){printf(" O O\n"); 阅读全文
posted @ 2021-10-27 11:32 BS--HARD 阅读(24) 评论(2) 推荐(0) 编辑