自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 收藏
  • 关注

原创 2020-12-10

第二次上机第一题:#include<iostream>#include<cmath>#include<vector>using namespace std;int main() { int m = 3, n = 5; // 利用vector创建二维数组 vector< vector<int> > vec11; vector<vector<int> > vec22(m, vector<int>(

2020-12-10 22:55:46 77

原创 第十题

#include<iostream>using namespace std;int main() { int n,i; cout << "请输入一个正整数n为" << endl; cin >> n; for (i = 1;i <= 2 * n - 1;i=i+2) { cout <<'*'*i << endl; cout << endl; } return 0;}不太会写,...

2020-11-19 15:51:55 66

原创 第九题

#include <iostream>#include <cmath>using namespace std;int main(){ float i,m; for (i = 100;i <= 200;i++) { m = sqrt(i); int a; a= m; if (m-a=0) { cout << a << endl;//如果m是整数则输出 } } return 0;}...

2020-11-19 15:51:04 53

原创 第八题

#include <iostream>#include <cmath>using namespace std;int main(){ double m; cout << "请随即输入一个数字" << endl; cin >> m; cout << sqrt(m) << endl; return 0;}

2020-11-19 15:50:08 94

原创 第七题

#include<iostream>using namespace std;int main() { float s; for (int r = 0;r <= 10;r++) { s = 3.1415 * r * r; if (s >= 100) { cout << r << " " << "面积s=" << s << endl; break; } } return 0;

2020-11-19 15:49:37 102

原创 第六题

#include<iostream>using namespace std;int main() { int a, b = 0, c = 0;//c为十个数之和 for (int x = 1; x <= 10; x++) { cout << "请随机输入一个数字" << endl; cin >> a; if (a >= 0) { b++; c += a; } } cout << "正数的个数b="

2020-11-19 15:49:00 62

原创 第五题

#include<iostream>using namespace std;int main() { int a, b; for (a = 1; a <= 4;a++) { for (b=1;b<=5;b++) cout << a*b << " "; cout << std::endl; } return 0;}

2020-11-19 15:48:26 40

原创 第四题

#include<iostream>using namespace std;int main() { int N, i, sum; cout << "请输入N的值" << endl; cin>>N; for(i=1,sum=0;i<=N;i++){ sum+=i; } cout << "和为" << sum << endl; return 0;}

2020-11-19 15:47:55 115

原创 第三题

#include<iostream>#include <cmath>using namespace std;int main() { int j, a, b, c; for (j= 100; j <= 999; j++) { c = j % 10; b = (j / 10) % 10; a = j / 100; if (j == a * a * a + b * b * b + c * c * c) cout << "水仙花数为" &l

2020-11-19 15:41:45 49

原创 第二题

```cpp#include<iostream>using namespace std;int main() { int a,b,c; cout << "请依次输入三角形三遍的长a、b、c的值" << endl; cin>>a>>b>>c; int p = (a + b + c) / 2; int s=sqrt(p*(p-a)* (p-b)* (p-c)); cout << "三角形面积是S=" &l.

2020-11-19 15:40:45 70

原创 第一题

第一题```#include<iostream>using namespace std;int main() { int a; int b; int c; cout << "请输入a=" << endl; cin >> a; cout << "请输入b=" << endl; cin >> b; cout << "请输入c=" << endl; cin >> c;

2020-11-19 15:39:40 97

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除