![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++练习c
netskyz
Winners are not those who never fail but those who never quit.
展开
-
程序设计教程第二版(钱能)1.9 练习1 第2题个人练习答案
#include <iostream> int main() { //part i for (int i = 0; i < 3; i++) { //print space for (int k = 3 - i; k >= 0; k--) { std::cout << " "; }原创 2017-05-23 18:10:16 · 423 阅读 · 0 评论 -
To Determine a Prime Number
#include <iostream> #include <cmath> using namespace std;int main() { cout << "Please input a number: " << endl; int m; cin >> m; double sqrtm = sqrt(m * 1.0); for (int i = 2; i <=原创 2017-05-23 23:54:35 · 186 阅读 · 0 评论 -
C++程序设计教程第二版钱能 2.9练习2第1题
#include <iostream> #include <iomanip> using namespace std;int main() { int x, n; long power, factorial; double series, subitem; short sign = -1; subitem = 0.0; series = 0.0;原创 2017-05-26 07:40:45 · 481 阅读 · 0 评论 -
Getting Perfect Number Less than 10000 With C++
get perfect number and show them like expression 6 = 1 + 2 + 3.#include <iostream>using namespace std;int main () { int sum; for ( int i = 2; i <= 10000; i++ ){ sum = 0; for ( i原创 2017-05-27 21:54:00 · 175 阅读 · 0 评论