diff --git a/.gitignore b/.gitignore index 02c7caa..d9a9f82 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,4 @@ Module.symvers Mkfile.old dkms.conf .idea/ +cmake-build-debug/ diff --git a/05/1/1.c b/05/1/1.c new file mode 100644 index 0000000..e1dc5c1 --- /dev/null +++ b/05/1/1.c @@ -0,0 +1,26 @@ +#include + +int main(){ + int n,a[10],temp; + + scanf("%d", &n); + + for(int i=0; i + +int main(){ + int n,a[10],max=0,min=0; + + scanf("%d", &n); + + for(int i=0; imax){ + max = a[i]; + } + if(a[i] + +int get_min(int a[20],int n,int temp){ + int min=2147483647; + for(int i=0;itemp)){ + min=a[i]; + } + } + return min; +} + +int main(){ + int n,a[20],b[20],min=-2147483648; + + scanf("%d",&n); + + for(int i=0; i +#include + +int main(){ + int n; + char a[50]; + + scanf("%s",a); + n=strlen(a)-1; + + for(int i=0;i 作业时间: 2021-11-16 19:43:00 至 2021-11-30 23:55:00 diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..81d0286 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,5 @@ +add_executable(1 05/1/1.c) +add_executable(2 05/2/2.c) +add_executable(no 05/3/no.c) +add_executable(c0604 05/4/c0604.c) +add_executable(CMakeLists CMakeLists.txt) \ No newline at end of file diff --git a/README.md b/README.md index bce7671..afca73b 100644 --- a/README.md +++ b/README.md @@ -44,3 +44,8 @@ A repo to record my study life. - [3. 【循环结构】要求输出100~200之间的不能被3整除的前10个和最后10个整数](https://github.com/xtaodada/C-study/tree/master/04-1/3) - [4. 【循环结构】使用循环的嵌套来输出以下4*5的矩阵](https://github.com/xtaodada/C-study/tree/master/04-1/4) - [5. 【循环结构】输入一个大于3的整数n,判定它是否素数(prime,又称质数)](https://github.com/xtaodada/C-study/tree/master/04-1/5) +- [实验五 数组及应用](https://github.com/xtaodada/C-study/tree/master/05) + - [1. 排序2](https://github.com/xtaodada/C-study/tree/master/05/1) + - [2. 查找最大最小整数](https://github.com/xtaodada/C-study/tree/master/05/2) + - [3. 给一个整型数组编号a](https://github.com/xtaodada/C-study/tree/master/05/3) + - [4. 回文判断](https://github.com/xtaodada/C-study/tree/master/05/4)