求助贴
c4droid吧
全部回复
仅看楼主
level 9
为什么结果是1.3.2
函数里面的不是把两个值互换了吗
2018年01月26日 07点01分 1
level 9
[小乖][小乖][小乖]
2018年01月26日 07点01分 2
level 9
2018年01月26日 07点01分 3
level 9
[乖][乖][乖][乖][乖]
2018年01月26日 07点01分 4
level 9
mei ren
2018年01月26日 07点01分 5
level 9
ma
2018年01月26日 07点01分 6
level 12
你看书没有[阴险]
2018年01月26日 07点01分 7
传送地址才能改变实参[笑眼]
2018年01月26日 08点01分
level 6
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;
const double PI=acos(-1.0);/*定义圆周率值等于arccos(-1)*/
struct complex/*复数结构体*/
{
double r,i;
complex(double _r=0.0,double _i=0.0)/*实数转换为复数*/
{
r=_r;
i=_i;
}
complex operator+(const complex&b)/*定义复数加法运算*/
{
return complex(r+b.r,i+b.i);
}
complex operator-(const complex&b)/*定义复数减法运算*/
{
return complex(r-b.r,i-b.i);
}
complex operator*(const complex&b)/*定义复数乘法运算*/
{
return complex(r*b.r-i*b.i,r*b.i+i*b.r);
}
};
/*对数组按二进制倒序排序*/
void change(complex y[],int N)
{
int i,j,k;
for(i=1,j=N>>1;i<N-1;i++)
{
if (i<j)swap(y[i],y[j]);
k=N>>1;
while (j>=k)
{
j-=k;
k>>=1;
}
j+=k;
}
}
/*快速傅里叶变换FFT(on==1时是正变换DFT,on==-1时是反变换IDFT)*/
void FFT(complex y[],int N,int on)
{
int i,j,k,h;
change(y,N);
for (h=2;h<=N;h<<=1)
{
complex wn(cos(-on*2*PI/h),sin(-on*2*PI/h));/*计算旋转因子wn*/
/*蝶形运算*/
for(j=0;j<N;j+=h)
{
2018年01月27日 02点01分 8
你干啥[挖鼻]
2018年01月28日 13点01分
level 6
函数穿进去的参数只是复制了一遍,而没有实质的对其本身进行操作。你需要这样
void f(int &v,int &w){...}
&在这里是引用的意思,这样v和w就完全是x和y了。不加&的话,v和w是与x和y完全不同的变量,只是初始值相同而已
2018年02月04日 05点02分 9
level 3
函数实现了交换但是你没把交换后的数传给实参
把函数改成 int f(int x,int y,int z)
返回值改成
return x,y,z;
试试吧,我今天刚看视频学函数
2018年02月04日 06点02分 10
level 6
你们键盘都是怎么弄的
2018年02月04日 12点02分 11
codeboard 这是键盘名称,你搜搜看
2018年02月05日 09点02分
codeboard 这是键盘名称,你搜搜看
2018年02月05日 09点02分
codeboard 这是键盘名称,你搜搜看
2018年02月05日 09点02分
@张2579730630 简称黑客键盘
2018年02月05日 17点02分
1