2104060427张喜海
2104060427张喜海
全部文章
分类
题解(6)
归档
标签
去牛客网
登录
/
注册
2104060427张喜海的博客
全部文章
(共6篇)
题解 | #利用指针遍历数组#
#include using namespace std; class Cube { public: void setLength(int length) { m_length=length; } void setWidth(int width) { m_width=width; } void s...
C++
2022-03-04
0
273
题解 | #计算小球走过的路程和反弹高度#
#include #include using namespace std; int main() { int a=2,b=2; // 下落的高度和落地的次数 double h,f,s,sum=0.0;//高度 int n;//词数 cin >> h; cin >> n;...
C++
2022-02-21
1
312
题解 | #编写函数实现两数交换(指针方式)#
#include using namespace std; // write your code here...... void lhy(int * p1,int * p2) { int temp =*p1; *p1=*p2; *p2=temp; } int main() { int m, n; ...
C++
2022-02-19
5
478
题解 | #创建动态数组#
#include using namespace std; int main() { int n; cin >> n; int h=n; int a[n+1]; // write your code here...... for(int i=0;i<n;i++) { a[i]...
C++
2022-02-19
1
283
题解 | #获取字符串长度#
#include using namespace std; int main() { int s=0; char str[100] = { 0 }; int len =sizeof(str)/sizeof(str[0]); cin.getline(str,100); // write your c...
C++
2022-02-19
0
373
题解 | #结构体简单使用#
#include #include using namespace std; struct student { // write your code here...... string name; int age; double height; }; void shuru (struct stu...
C++
2022-02-19
0
212