当前位置:网站首页>C language pointer practice questions
C language pointer practice questions
2022-08-10 01:48:00 【BSP Junior Primary School Monk】
1. Use the pointer method to calculate the sum of the corresponding positions of each element in the two arrays, and store the result of the sum in the third array, and then output.
#include void count(int *p1,int *p2,int *p3,int x);int main(){int arr01[4]={2,4,5,8};int arr02[4]={1,0,4,6};int arr03[4];count(arr01,arr02,arr03,4);}void count(int *p1,int *p2,int *p3,int x){int i;for(i=0;i
Run result:
2. Using the pointer, output the alphabet in sequence, and then output in reverse order.
#include #include int main(){char *p01=(char *) malloc(sizeof(char)*26);char *p02=(char *) malloc(sizeof(char)*26);int i;printf("Output in uppercase alphabetical order:\n");for(i=0;i<26;i++){*(p01+i)=('A'+i);printf("%c ",*(p01+i));}printf("\n\n");printf("Output in lowercase alphabetical order:\n");for(i=0;i<26;i++){*(p02+i)=('a'+i);printf("%c ",*(p02+i));}printf("\n\n");printf("Reverse uppercase letters:\n");for(i=25;i>=0;i--){printf("%c ",*(p01+i));}printf("\n\n");printf("Reverse lowercase output:\n");for(i=25;i>=0;i--){printf("%c ",*(p02+i));}return 0;}
Run result:
边栏推荐
- -向量点积-
- PEG 衍生物Biotin-PEG1-OH(cas:95611-10-2,2-生物素氨基乙醇)优势说明
- Today's sleep quality record 61 points
- 地雷数量求解
- MATLB|和她跌宕起伏最终到达人生之峰【浪漫旅途】
- Leetcode82. 删除排序链表中的重复元素 II
- Mysql database ALTER basic operations
- R语言使用glm函数构建logistic回归模型,使用forestmodel包的forest_model函数可视化逻辑回归模型对应的森林图
- 字节技术面都过了,薪资都谈好了20K*13结果还是被刷了,问HR原因是。。。
- Biotin-Cy2 Conjugate, Biotin-Cy2 Conjugate_Cy2 Biotin Conjugate
猜你喜欢
宝塔实测-搭建LightPicture开源图床系统
Leetcode81. 搜索旋转排序数组 II
2022金九银十工作潮,怎么样才能成功跳槽面试拿到高薪呢?
《痞子衡嵌入式半月刊》 第 60 期
游泳馆系统次卡的设置有哪些细节?
02| operator
Involved in PEG-Biotin (CAS: 1778736-18-7) Biotin-PEG4-OH is widely used in molecular target detection
PEG derivative Biotin-PEG1-OH (cas: 95611-10-2, 2-biotinaminoethanol) advantage description
WPF DataGrid 使用数据模板
PEG 衍生物Biotin-PEG1-OH(cas:95611-10-2,2-生物素氨基乙醇)优势说明
随机推荐
Spark基础【RDD单Value类型转换算子】
D-Biotinol Involved by Biotin, CAS No: 53906-36-8 Specific Properties Description
-象棋比赛-
基于FPGA的任意字节数的串口接收(含源码工程)
Web性能测试模型小结
JVM Memory and Garbage Collection - 10. Direct Memory
LeetCode常见题型——链表
-Chess game-
Kubernetes服务接入Istio
2022中高级Android面试题汇总来助你通过面试
考柏的感慨
最高月薪15K,谁有历经千辛万苦的意志,谁就能收获属于自己的成功~
flask——请求、响应、请求扩展、session、闪现、蓝图、g对象、flask-session
02| operator
Docker interview question 2--get the number of database connections and docker-compose
03|流程控制
MATLB|And her ups and downs and finally reached the peak of life [Romantic Journey]
R语言使用coxph函数构建生存分析回归模型,使用forestmodel包的forest_model函数可视化生存回归模型对应的森林图
CAS:183896-00-6 (Biotin-PEG3-C3-NH2) PEG衍生物
CAS:851113-28-5 (Biotin-ahx-ahx-tyramine)