- 博客(10)
- 收藏
- 关注
原创 矩阵相乘
代码如下:#include<stdio.h>int main(){ int a[3][3],b[3][3]; int c[3][3]={0}; int i,j,k; for(i=0;i<3;i++) { for(j=0;j<3;j++) { scanf("%d",&a[i][j]); } } for(i=0;i<3...
2018-09-18 20:53:11
253
原创 一元多项式加法运算(二)
方法二:#include<stdio.h>#include<math.h>#include<string.h>//#include<algorithm>#include<iostream>using namespace std;int a[10000],b[10000];int main(){ memset(a,...
2018-09-18 20:52:07
317
原创 一元多项式加法运算(一)
采用结构体#include<iostream>using namespace std;struct data{ int x; int y;}stu11[100]={0,0},stu22[100]={0,0};//结构体 ,x为系数,y为指数 int main(){ void change(struct data a[],int n); int i=-1,...
2018-09-18 20:50:54
749
原创 计算鸡
OJ水#include<stdio.h>#include<string.h>int main(){ char s[60]; int i; int a,b,c,d; int len; while(~scanf("%s",s)) { a=0;b=0;c=0;d=0; len=strlen(s); for(i=0;i<len;i++)...
2018-09-18 20:48:03
353
原创 汉罗塔问题
代码如下:(改代码采取递归思想)#include<iostream>using namespace std;void move(char src,char dest){ cout<<src<<"-->"<<dest<<endl;}void hanno(int n,char src,char medium..
2018-09-18 20:46:34
203
原创 分离字符串
此代码为C语言编写:#include<stdio.h>#include<string.h>int main(){ char a[200],b[200],c[200],d[200]; int r,s,t; int i; int len; while(~scanf("%s",a)) { r=0,s=0,t=0; len=strlen(a);...
2018-09-18 20:44:58
701
1
原创 C++公司类镶嵌员工类
写得不好之处,希望多多指点 运行效果如下: 功能栏可以无限循环 头文件:#include<iostream>#include<string>using namespace std;员工类://员工类 class Employee{ private: string name; int age; ...
2018-09-18 20:24:20
3075
2
原创 C++编程第一个程序
c++编译环境:Dev-c++5.11,VC6.0,VS编译器等 “Hello C++!” #include<iostream>using namespace std;int main(){ cout<<"Hello C++!"<<endl; return 0;}
2018-09-18 20:04:35
238
原创 跳一跳游戏序列处理
编译环境: VC6.0,Dev-c++,VS等;代码如下:#include<iostream>using namespace std;int main(){ int n; int a=0,b=0; int sum=0; while(cin>>n)//连续输入一串数字 { if(n==1) { sum++;...
2018-09-18 19:51:40
177
原创 C++构造一个简单的三角形类源码
头文件#include<iostream>#include<cmath>using namespace std;构造一个三角形类class Triangle{ public: Triangle(float A,float B,float C); ~Triangle(){} //析构函数 float circumference(...
2018-09-18 13:15:41
5504
2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人