uacs2024

导航

2024年3月20日 #

复试C++15真题_程序设计2_递归_输入字符串倒序转整形

摘要: 编写一个递归函数,功能为:输入一个字符串,输出一个整数值。例如输入 "1a2xcz3 4 ,5a!6" , 输出654321。 一开始想不明白怎么写递归,于是我写了迭代的函数。意识到,递归的过程就是实现了迭代的循环,而循环内的操作本质没有太大差别。于是就写出来了: #include <iostrea 阅读全文

posted @ 2024-03-20 20:42 ᶜʸᵃⁿ 阅读(5) 评论(0) 推荐(0) 编辑

复试C++14真题 看程序写结果5 虚函数、继承 易错?

摘要: 复试C++14真题 看程序写结果5 虚函数、继承 #include <iostream> using namespace std; class A{ public: virtual void print() {cout<<"A::print"<<endl;} //void print() {cout 阅读全文

posted @ 2024-03-20 18:31 ᶜʸᵃⁿ 阅读(1) 评论(0) 推荐(0) 编辑

C++一些函数用法

摘要: substr(start , lenth) erase(start , lenth) assign(v.begin() , v.end()) vl(a+i , a+j) 相当于用a[i] 到 a[j-1] 的元素初始化v1 , 包括a[j-1] stod函数用法 stoi函数用法 #include 阅读全文

posted @ 2024-03-20 14:44 ᶜʸᵃⁿ 阅读(2) 评论(0) 推荐(0) 编辑