随笔分类 -  C++

摘要:#include<iostream>#include<cmath>using namespace std;class Point{ private: double x; double y; double z; public: Point(double a,double b,double c):x(a 阅读全文
posted @ 2023-05-23 09:26 不会JAVA的小袁 阅读(10) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>using namespace std;class Horse{ public: Horse(){ cout<<"Horse 申请了空间..."<<endl; } virtual void Fly(){ cout<<"Just a horse."<<endl; } 阅读全文
posted @ 2023-05-23 09:08 不会JAVA的小袁 阅读(14) 评论(0) 推荐(0) 编辑
摘要:#include <iostream>#include <iomanip>using namespace std;class Shape{ public: const double PI; Shape():PI(3.1415926){ } virtual double Area()=0;};clas 阅读全文
posted @ 2023-05-23 08:51 不会JAVA的小袁 阅读(19) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<cmath>#include<stdexcept>using namespace std;double area(double a,double b,double c) throw (invalid_argument){ if(a<=0||b<= 阅读全文
posted @ 2023-05-19 21:15 不会JAVA的小袁 阅读(3) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<string>using namespace std;class MyException{ public: MyException(const string &message):message(message){} ~MyException(){ 阅读全文
posted @ 2023-05-19 21:04 不会JAVA的小袁 阅读(13) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<algorithm>#include<functional>#include<vector>using namespace std;int main(){ int iarray[]={26,17,15,22,23,33,32,40}; vecto 阅读全文
posted @ 2023-05-19 20:52 不会JAVA的小袁 阅读(3) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<algorithm>#include<functional>#include<iterator>#include<vector>using namespace std;class evenByTwo{ private: int x; public 阅读全文
posted @ 2023-05-18 13:53 不会JAVA的小袁 阅读(6) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<algorithm>#include<functional>#include<vector>using namespace std;int main(){ int iarray[]={0,1,2,3,4,5,6,6,6,7,8}; vector< 阅读全文
posted @ 2023-05-18 13:12 不会JAVA的小袁 阅读(3) 评论(0) 推荐(0) 编辑
摘要:#include<fstream>#include<iostream>using namespace std;int main(int){ ifstream inf; inf.open("abc.txt"); ofstream outf; outf.open("abc_back.txt"); cha 阅读全文
posted @ 2023-05-17 20:19 不会JAVA的小袁 阅读(8) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>using namespace std;int main(){ int n; cout<<"Input n: "; cin>>n; cout<<"Dec: "<<dec<<n; cout<<" "<<"Oct: "<<oct<<n; cout<<" "<<"Hex 阅读全文
posted @ 2023-05-17 20:08 不会JAVA的小袁 阅读(7) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<fstream>using namespace std;class Dog{ public: int gdoga() { return a; } int gdogw() { return w; } void setdog(int x,int y) 阅读全文
posted @ 2023-05-17 19:59 不会JAVA的小袁 阅读(9) 评论(0) 推荐(0) 编辑
摘要:#include <iostream>#include <iomanip>using namespace std;class matrix{private: int row,column; int **mat;public: matrix(const matrix& mx){ this->row=m 阅读全文
posted @ 2023-05-16 20:58 不会JAVA的小袁 阅读(16) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>using namespace std;class Time{ private: int hour; int minute; public: Time(int h=00,int m=00){ hour=h; minute=m; } int friend opera 阅读全文
posted @ 2023-05-16 09:26 不会JAVA的小袁 阅读(42) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>using namespace std;class FS{ private: int fz; int fm; public: FS() { fm=1; fz=0; } void set(int m,int z) { fm=m; fz=z; } void del() 阅读全文
posted @ 2023-05-16 09:15 不会JAVA的小袁 阅读(23) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<string>using namespace std;int main(){ string line; cout<<"Type a line terminated by 't'"<<endl; getline(cin,line,'t'); cou 阅读全文
posted @ 2023-05-15 11:57 不会JAVA的小袁 阅读(10) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<fstream>using namespace std;int main(){ ifstream file("integers",ios_base::in | ios_base::binary); if(file){ while (file){ 阅读全文
posted @ 2023-05-15 11:49 不会JAVA的小袁 阅读(9) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<sstream>#include<string>using namespace std;template<class T>inline T fromString(const string &str){ istringstream is(str); 阅读全文
posted @ 2023-05-15 11:41 不会JAVA的小袁 阅读(8) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<fstream>using namespace std;int main(){ int values[]={3,7,0,5,4}; ofstream os("integers",ios_base::out | ios_base::binary); 阅读全文
posted @ 2023-05-15 11:32 不会JAVA的小袁 阅读(12) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<fstream>#include<cstring>using namespace std;struct SalaryInfo{ unsigned id; double salary;};int main(){ SalaryInfo employe 阅读全文
posted @ 2023-05-15 11:21 不会JAVA的小袁 阅读(12) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>using namespace std;int main(){ char ch; while((ch=cin.get()) !=EOF) cout.put(ch); return 0;} 阅读全文
posted @ 2023-05-14 19:55 不会JAVA的小袁 阅读(10) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示