摘要:
实验任务1 实验任务2 #include <stdio.h> #include <string.h> #define N 10 // 定义结构体类型struct student,并定义其别名为STU typedef struct student { long int id; char name[20 阅读全文
摘要:
实验任务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; print 阅读全文
摘要:
实验1 找出最大数并放到数组的最后 #include<stdio.h> #define N 5 //找到数组中最大的元素 //并将其交换放到数组最后一个元素中 void output(int x[],int n); int main() { int x[N]={9,55,30,27,22}; int 阅读全文
摘要:
实验任务1.1 #include<stdio.h> const int N=4; int main() { int a[4]={2,0,2,1}; char b[4]={'2','0','1','1'}; int i; printf("sizeof(int)=%d\n",sizeof(int)); 阅读全文
摘要:
实验任务1 //利用局部static变量的特性,计算阶乘 #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++) 阅读全文
摘要:
实验任务1 #include<stdio.h> int main() { int num; scanf_s("%d", &num); printf("2049%04d\n", num); scanf_s("%d", &num); printf("2049%04d\n", num); scanf_s( 阅读全文
摘要:
//打印一个字符小人 #include <stdio.h> int main() { printf(" o \n"); printf("<H>\n"); printf("I I\n"); printf(" o \n"); printf("<H>\n"); printf("I I\n"); retur 阅读全文