- 博客(5)
- 收藏
- 关注
原创 C++,求出数字包含7或者能被7整除的数字
#include <iostream>#include <cmath>using namespace std;int main(){ int i,a,b,c,d,bcd,cd; for (i=7;i<=10;i++) { if (i%7==0) { cout << ...
2019-09-29 10:56:40 6939 1
原创 C++求10000以内的指数
#include <iostream>using namespace std;int main(){ int i,j; for (i=0;i<=10000;i++) { for (j=2;j<=i;j++) { if (i%j==0) { ...
2019-09-29 10:12:33 190
原创 C++ 割圆求π
#include <iostream>#include <cmath>#include <iomanip>using namespace std;int main(){ int c=6,d=2; int i=1; double m=1; while (i<15) { m=sqrt(2-...
2019-09-23 15:24:26 714
原创 C++ 比较两数的大小的三种方法
#include <iostream>using namespace std;int adds(int x, int y);int main(){ int a,b; a=20; b=10; cout << adds(a,b) << endl;}int adds(int x, int y){ if (...
2019-09-06 11:20:12 32139 2
原创 C++ 两个整数相除结果为什么不为小数?
#include <iostream>#include <iomanip>using namespace std;int main(){ int a=4; double b=2.0; cout << (float)a/b <<endl; return 0;}
2019-09-05 18:09:45 4899 2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人