![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
基础题
XTL151384
这个作者很懒,什么都没留下…
展开
-
C++基础题:求多位正整数各位之和
#include<iostream>using namespace std; int main(){ int a,b = 0; for(cin >> a; a; a/=10)//注意for循环的写法 { b += a % 10; } cout << b << endl; return 0;} ...原创 2018-12-02 21:09:01 · 1007 阅读 · 0 评论 -
C++函数重载简单例题
Description写出3组Plus函数的声明与实现,类型分别为int,double,string主函数如下,注意只需要实现Plus函数和包含相关的头文件。int main() {int n; int a,b;double c,d;std::string str1,str2;std::cin>>n;while(n--){std::cin>>a...原创 2018-12-11 19:14:08 · 1371 阅读 · 0 评论