当前位置: 首页 > wzjs >正文

自己的网站怎么做搜索张家界做网站的

自己的网站怎么做搜索,张家界做网站的,单页网站在线制作,人力招聘网站建设的简要任务执行书一、1134矩阵翻转 1.题目描述 2.解题思路 很简单的模拟题&#xff0c;甚至只是上下翻转&#xff0c;遍历输出的时候先把最下面那一行输出即可。 3.代码 #include <iostream> #include <vector> using namespace std;int main() {int n;cin >> n;vector&l…

一、1134矩阵翻转

1.题目描述

2.解题思路

很简单的模拟题,甚至只是上下翻转,遍历输出的时候先把最下面那一行输出即可。

3.代码

#include <iostream>
#include <vector>
using namespace std;int main() {int n;cin >> n;vector<vector<int>> matrix(n, vector<int> (n, 0));for(int i = 0; i < n; i++) {for(int j = 0; j < n; j++) {cin >> matrix[i][j];}}for(int i = n - 1; i >= 0; i--) {for(int j = 0; j < n; j++) {cout << matrix[i][j] << ' ';}cout << endl;}return 0;
}

二、1052学生成绩管理

1.题目描述

2.解题思路

涉及到结构体的一些复习,不过具体怎么写大体的思路都在题目要求里写了,主要就是结构体相关输入输出和数据处理。

关键点:如何保证输出的数据保留一位小数。引入头文件<iomanip>,cout中设置setprecision即可。 cout << fixed << setprecision(1) << students[i].xingming......

3.代码

ps:有的垃圾编译器连INT_MIN都识别不了。

#include <iostream>
#include <string>
#include <vector>
#include <iomanip>
using namespace std;struct student{string xuehao;string banji;string xingming;double grade[3];double avg;
};vector<student> shuru(vector<student> students, int n) {for(int i = 0; i < n; i++) {cin >> students[i].xuehao >> students[i].banji >> students[i].xingming;for(int j = 0; j < 3; j++) {cin >> students[i].grade[j];}}return students;
}vector<student> avgGrade(vector<student> students, int n) {double sum = 0;for(int i = 0; i < n; i++) {sum = 0;for(int j = 0; j < 3; j++) {sum += students[i].grade[j];}students[i].avg = sum / 3;}return students;
}int main() {int n;cin >> n;vector<student> students(n);students = shuru(students, n);students = avgGrade(students, n);for(int i = 0; i < n; i++) {cout << fixed << setprecision(1) << students[i].xingming << ' ' << students[i].avg << endl;}int index = 0;double maxAvg = INT_MIN;for(int i = 0; i < n; i++) {if(students[i].avg > maxAvg) {index = i;maxAvg = students[i].avg;}}cout << fixed << setprecision(1) << students[index].xuehao << ' '<< students[index].banji <<' '<< students[index].xingming <<' '<< students[index].grade[0] <<' '<< students[index].grade[1] <<' '<< students[index].grade[2] << ' '<< students[index].avg;return 0;
}

三、1409对称矩阵

1.题目描述

2.解题思路

很弱智

简单的模拟题,对称矩阵就是判断a[i][j]和a[j][i]是否相等,有一个不相等就不是对称矩阵。

3.代码

#include <iostream>
#include <vector>
using namespace std;int main() {int n;while(cin >> n) {int flag = 1;vector<vector<int>> matrix(n, vector<int> (n, 0));for(int i = 0; i < n; i++) {for(int j = 0; j < n; j++) {cin >> matrix[i][j];}}for(int i = 0; i < n; i++) {for(int j = 0; j < n; j++) {if(matrix[i][j] != matrix[j][i]) {flag = 0;}}}if(flag == 0) {cout << "No!" << endl;} else {cout << "Yes!"<< endl;}}return 0;
}


文章转载自:

http://Lm8PZxxu.zdpjr.cn
http://bNV6TsGL.zdpjr.cn
http://PKrg01Rk.zdpjr.cn
http://VAdJyYQc.zdpjr.cn
http://cAx0uBZj.zdpjr.cn
http://U4KlYoA0.zdpjr.cn
http://Tuu2WqWT.zdpjr.cn
http://dvN2Ghhy.zdpjr.cn
http://6egRJaxo.zdpjr.cn
http://yWkJf68w.zdpjr.cn
http://QAGU3JcD.zdpjr.cn
http://4bqpudrA.zdpjr.cn
http://juNZ1rlp.zdpjr.cn
http://izfTLmfx.zdpjr.cn
http://pnqx08LM.zdpjr.cn
http://g3ps2kf6.zdpjr.cn
http://CjQ8CbTj.zdpjr.cn
http://qCmLjwtF.zdpjr.cn
http://aFKsgatE.zdpjr.cn
http://5jF01YGP.zdpjr.cn
http://8HtwHvAQ.zdpjr.cn
http://pmdSTdeC.zdpjr.cn
http://Yzl8kSyK.zdpjr.cn
http://MCnRaY5f.zdpjr.cn
http://W5E3h9MX.zdpjr.cn
http://YLJgx4Q9.zdpjr.cn
http://Ip71hnJM.zdpjr.cn
http://baxqgJFc.zdpjr.cn
http://B0VQNYyv.zdpjr.cn
http://h3cFzlW8.zdpjr.cn
http://www.dtcms.com/wzjs/624647.html

相关文章:

  • 河北省建设厅网站重新安装图文设计
  • 花都营销型网站房地产市场名词解释
  • 个人网站的首页access 数据库做网站
  • 网站提示危险网站笑话类网站用什么做
  • 购物网站设计需要哪些模块wordpress签到
  • 微商城设计网站建设网页设计与制作教案 详案
  • 软件开发与网站建设无锡2019网站建设报价清单
  • 南京博物馆网站哪家做的暴雪和网易终止合作
  • 网站板块策划建设网站需要的资质证书
  • easyui 网站设计正能量网站地址链接免费
  • 网站访问找不到域名怎么回事买服饰网站建设
  • appcan 手机网站开发织梦cms做企业网站
  • 头像在线制作网站wordpress+帖子置顶
  • 怎么做网站源代码跨境电商怎么入行
  • 什么是网站微商城的建设北京app开发公司有哪些
  • 网站建设图片怎么动wordpress安装在vps
  • ios6软件下载网站响应式网站怎么做pc端的
  • 南宁专业网站制作前十排名河北邢台是不是很穷
  • 做网站手机验证收费吗长洲网站建设
  • 提供营销单页网站网站开发一个人可以完成吗
  • 网站建设如何设计数据库网站怎么备案在哪里
  • 用php写的网站wordpress怎么修改关键字
  • 中国城乡住房和城乡建设部网站首页网站建设与维护心得
  • 网站开发主要内容和要求找网站开发
  • 织梦统计网站访问量代码做网站需要学习多久
  • 延边网站开发局域网站开发
  • 网站网络营销诸城建设局网站
  • 中小型企业查询网站深圳app开发公司鑫酷
  • 找网站的方法哪个手机网站 有app
  • 12380网站建设的意见建议高校建设思政教育网站案例