編程復數i
『壹』 C語言中復數怎麼定義 我想用i*i=-1
用一個結構體分別定義它的實部和虛部,然後再定義運算規則即可。
『貳』 I復數形式
「I 」的復數是「We」
we英[wi]美[wi]
pron.我們
詞語用法
pron. (代詞)
we是復數第一人稱代詞的主格形式,其賓格形式是us。在句中用作主語時須用主格形式; 用作賓語時用賓格形式; 用在動詞be後作表語時有時可用主格形式,有時可用賓格形式,如we作為後面句子的真正主語而被強調,則須用主格形式。
we有時可不翻譯。
例句
It was we who had been wrong.
是我們錯了。
We had much rain last year.
去年雨量充足。
(2)編程復數i擴展閱讀:
近義詞的用法
our英['aʊə(r) ]美['aʊər]
adj.我們的
詞語用法
pron. (代詞)
our是第一人稱復數形容詞性物主代詞,只可用作定語。
例句
用作形容詞 (adj.)
This is our classroom.
這是我們的教室。
Our school is on a river.
我們的學校在河邊。
『叄』 想知道i復數是什麼呢
「I」的復數是「We」,「We」是我們的意思,是第一人稱的復數形式。
其他人稱的復數形式舉例列表如下:
英語復數相關後綴
-s
-s是最常見的名詞復數後綴,比如:
computer—computers
某些以-s結尾的名詞卻並不是某個單數形式的變形,而是一個獨立的形式,如:news,shorts,summons,billards,works,trousers。其中動詞可能是單數也可能是復數,視詞的具體情況而定。
這類詞一般都是源於復數形式-s,但summons是源於法語陰性過去分詞sumunse。
-es
某些名詞復數由-es構成,比如box—boxes。
與-s類似,某些以-s結尾的名詞卻並不是某個單數形式的變形,而是一個獨立的形式,如clothes。
『肆』 i的復數形式是什麼
i的復數形式是we,具體釋義如下:
讀音:英[wi; wiː]、美[wi]
表達意思:作代詞時意為「我們(主格);筆者,本人(作者或演講人使用);朕,寡人」,作名詞時意為「人名;(緬)韋」。
詞性:通常在句中用作名詞和代詞。
固定搭配:We Are The World天下一家;The Way We Were往日情懷
例句:
So, I guess we have to do this.
那麼,我想我們不得不這么做。
We boast of what we have and do.
我們誇耀我們所擁有的和所做的。
We should help him rather than he should help us.
是我們應該幫助他而不是他應該幫助我們。
『伍』 C#復數的編程
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management;
namespace ConsoleApplication1
{
class Program
{
class Complex
{
public Complex() { realPart = 0; imaginaryPart = 0; }
public Complex(float real, float imaginary) { realPart = real; imaginaryPart = imaginary; }
public override string ToString()
{
string result = realPart.ToString();
if (imaginaryPart >= 0) result += "+";
result += imaginaryPart.ToString() + "i";
return result;
}
static public Complex operator +(Complex a, Complex b)
{
Complex result = new Complex();
result.realPart = a.realPart + b.realPart;
result.imaginaryPart = a.imaginaryPart + b.imaginaryPart;
return result;
}
static public Complex operator -(Complex a)
{
Complex result = new Complex(-a.realPart, -a.imaginaryPart);
return result;
}
static public Complex operator -(Complex a,Complex b)
{
return a + (-b);
}
static public Complex operator *(Complex a, Complex b)
{
Complex result = new Complex ();
result.realPart = (a.realPart * b.realPart) - (a.imaginaryPart * b.imaginaryPart);
result.imaginaryPart = (a.realPart * b.imaginaryPart) + (a.imaginaryPart * b.realPart);
return result;
}
static public Complex operator /(Complex a, Complex b)
{
Complex result = new Complex();
Complex Conjugal = new Complex(b.realPart, -b.imaginaryPart);
float denominator = (b.realPart * b.realPart) + (b.imaginaryPart * b.imaginaryPart);
result = a * Conjugal;
result.realPart /= denominator;
result.imaginaryPart /= denominator;
return result;
}
private float realPart;
private float imaginaryPart;
}
static void Main(string[] args)
{
Complex a = new Complex(3, 5);
Complex b = new Complex(2, 3);
Console.WriteLine(a.ToString());
Console.WriteLine(b.ToString());
Console.WriteLine((a + b).ToString());
Console.WriteLine((a - b).ToString());
Console.WriteLine((a * b).ToString());
Console.WriteLine((a / b).ToString());
}
}
}
『陸』 I 的復數是什麼
「I」的復數是「We」,「We」是我們的意思,是第一人稱的復數形式。
其他人稱的復數形式舉例列表如下:
(6)編程復數i擴展閱讀:
1、集體名詞,以單數形式出現,但實為復數。例如:people、police、cattle 等本身就是復數,不能說 a people,a police,a cattle,但可以說a person,a policeman,a head of cattle。
2、由一個詞加 man 或 woman構成的合成詞,其復數形式也是 men 和women,如an Englishman,two Englishmen。但German不是合成詞,故復數形式為Germans;Bowman是姓,其復數是the Bowmans。
『柒』 C++編程,定義一個復數類
//complex類
#include<iostream.h>
#include<math.h>
class complex{
double real,imag;
public:
complex(){real=5;imag=5;}//預設構造函數
complex(double r){real=r;imag=0;}//只給實部賦值的構造函數
complex(double r,double i){real=r;imag=i;}//同時給實、虛部賦值的函數
double displayreal(){return real;}//返回復數實部
double displayimag(){return imag;}//返回復數虛部
complex operator+(complex c);//實現復數相加
complex operator-(complex c);//實現復數相減
complex operator*(complex c);//實現復數相乘
double cab(complex c);//求復數絕對值(模)
complex sqr(complex c);//求復數平方根
friend ostream &operator<<(ostream &out,complex &obj);//實現復數的輸出
};
complex complex::operator+(complex c)//實現復數相加
{
real+=c.real;
imag+=c.imag;
return *this;
}
complex complex::operator-(complex c)//實現復數相減
{
real-=c.real;
imag-=c.imag;
return *this;
}
complex complex::operator*(complex c)//實現復數相乘
{
real=real*c.real-imag*c.imag;
imag=real*c.imag+imag*c.real;
return *this;
}
double complex::cab(complex c)//求復數絕對值(模)
{
double ri;
ri=sqrt(c.real*c.real+c.imag*c.imag);
return ri;
}
complex complex::sqr(complex c)//求復數平方根
{
real=sqrt((cab(c)+c.real)/2);
imag=sqrt((cab(c)-c.real)/2);
return *this;
}
ostream &operator<<(ostream &out,complex &obj)//實現復數的輸出
{
if(obj.imag==0)out<<obj.real;
else out<<obj.real<<"+"<<obj.imag<<"i";
return out;
}
void answer(double a,double b,double c)//求根函數
{
complex answer1,answer2;
double an=b*b-4*a*c;
if(an>=0)
{
answer1=complex((-b+sqrt(an))/(2*a));
answer2=complex((-b-sqrt(an))/(2*a));
}
else
{
answer1=complex(-b/(2*a),sqrt(-an)/(2*a));
answer2=complex(-b/(2*a),-sqrt(-an)/(2*a));
}
cout<<"The answer is:"<<endl;
cout<<answer1<<" and "<<answer2<<endl;
}
int main()//主函數
{
complex a,b(2),c(6,9);//以下測試類中定義的各個函數,你可以刪除的
cout<<"a="<<a<<", b="<<b<<", c="<<c<<endl;
c=a+b;
cout<<"a+b="<<c<<endl;
cout<<"a="<<a<<", b="<<b<<", c="<<c<<endl;
c=a-b;
cout<<"a-b="<<c<<endl;
cout<<"a="<<a<<", b="<<b<<", c="<<c<<endl;
c=a*b;
cout<<"a*b="<<c<<endl;
cout<<"a="<<a<<", b="<<b<<", c="<<c<<endl;
cout<<"cab(a)="<<a.cab(a)<<endl;
cout<<"a="<<a<<", b="<<b<<", c="<<c<<endl;
cout<<"sqr(a)="<<a.sqr(a)<<endl;//以上測試類中定義的各個函數
answer(1,1,1);//方程解為虛數的情況
answer(1,3,1);//方程解為實數的情況
return 0;
}
『捌』 編程中i和j代表什麼
你這個代碼是畫一個半個的半個的菱形吧~
(*^__^*) 嘻嘻……其實i就是代表有幾行,那j呢就代表了這幾行我有幾個星星嘍
『玖』 matlab 中復數如何表示我i前面已經有*就是表示不出來不知到為什麼
你i是不是已經被定義為變數了,正常i就是復數單位,可以這樣表示的.
『拾』 matlab中的復數i怎麼輸入
i是虛數單位,這是一個復數。如果你確定結果應該是實數而且程序沒錯的話,可能因為浮點數誤差的關系出現一個非常非常小的虛部,用real(a)直接把它去掉即可。
復數x被定義為二元有序實數對(a,b),記為z=a+bi,這里a和b是實數,i是虛數單位。