- 博客(7)
- 收藏
- 关注
原创 插入排序的结构体做法
#includeusing namespace std;struct node{ int x; struct node *next; node(){ x=0;next=NULL; }};int main(){ int i,j,k,m,n; node *h,*p,*q; h=new node; cin>>n; for(i=1;i<=n;i+
2016-07-18 21:48:08 621
原创 全排列题解
#include#include#include#include#include#include#includeusing namespace std;int print();int a[100000];bool b[100000];int m;void search(int n){ for(int i=1;i<=m;i++){ if(!b
2016-07-15 21:57:47 267
转载 模仿的机器翻译
#include#include#include#include#include#includeusing namespace std;int a[100000],b[100000];int main(){ int m,n,t=0,k,f; cin>>m>>n; k=0; for(int i=1;i<=n;i++){ cin>>a[i];
2016-07-14 21:31:22 417
原创 我的多项式输出
题目描述一元 n 次多项式可用如下的表达式表示:其中,aixi称为 i 次项,ai 称为 i 次项的系数。给出一个一元多项式各项的次数和系数,请按照如下规定的格式要求输出该多项式:1.多项式中自变量为 x,从左到右按照次数递减顺序给出多项式。2.多项式中只包含系数不为 0 的项。3.如果多项式 n 次项系数为正,则多项式开头不出现“+”号,如果多项式 n 次项系数为负,
2016-07-14 16:51:43 533
原创 改进的最大公约数和最小公倍数问题
#include#include#include#include#includeusing namespace std;int main(){ int i,j,k,u,m,n,p,t,ans=0; cin>>m>>n; if(n%m!=0){ cout<<0<<endl; return 0; } k=sqrt(n*m);
2016-07-14 16:49:20 256
原创 排队接水
#include#include#includeusing namespace std;int a[1010];int b[1010];int main(){ int n,i,r,weizi,p=0,d,e; double k=0,ans=0; cin>>n; r=n;//1+13+46+101+157+256+355+589+1401 for(i=1;
2016-07-14 16:17:02 316
原创 这么久总算过了删数问题~~
#include#include#include#includeusing namespace std;char s[1000000];int main(){ int n,i,m,j,p; scanf("%s",&s); cin>>n; int k=strlen(s); for(i=1;i for(j=0;
2016-07-14 15:26:26 287
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人