07 2020 档案

摘要:将using namespace std; 删除后保存cpp文件, 再加上using namespace std;保存cpp文件。 阅读全文
posted @ 2020-07-17 18:07 为红颜 阅读(2350) 评论(0) 推荐(0)
摘要:#include<string> #include<iostream> using namespace std; int main() { string s("12345asdf"); string a = s.substr(0,5); //获得字符串s中从第0位开始的长度为5的字符串 cout < 阅读全文
posted @ 2020-07-15 10:18 为红颜 阅读(260) 评论(0) 推荐(0)
摘要:我们从已有f2.dat文件中读取10个数据,将他们排好序之后再存放到f2.dat中。 #include <iostream> #include <fstream> #include<string> #include<cmath> using namespace std; int main( ) { 阅读全文
posted @ 2020-07-13 20:05 为红颜 阅读(337) 评论(0) 推荐(0)
摘要:1. 计算三角形面积: 首先判断 是否构成三角形,在进行判定。并抛出错误处理。 #include <iostream> #include <string> #include<cmath> using namespace std; double floor(double x, double y, do 阅读全文
posted @ 2020-07-13 18:17 为红颜 阅读(254) 评论(0) 推荐(0)