一道C 程式設計題,一道c 程式設計題

2021-08-09 19:16:46 字數 3500 閱讀 6801

1樓:風若遠去何人留

多數問題為存心造成  打錯字為主

修改後如下

#include

#include//加一個標頭檔案 為str***函式

using namespace std;

class binary

;binary::binary(char *p)

binary::binary(int n)

}binary operator+(binary n1,binary n2)

return r;

}binary operator-(binary n1,binary n2)

return r;

}binary::operator int()//binary 打錯了

void binary::print()//binary 打錯了

{char str[17];

strncpy(str,bits,16);

str[16]='\0';

cout<

ps:你用的什麼ide? 給出的錯誤太籠統了 有可能的話 換一個吧 太差

2樓:滿旭亓官智敏

//在vs2008下完成編譯,如果在其他編譯器上不能正確編譯,請更改下面的#include

語句和using

語句(一般是將沒有.h字尾的新增上.h字尾,去掉using語句)#include

#include

#include

using

std::cout;

using

std::endl;

using

std::strlen;

template

tmaxn(t

inarray,int

arraycount)//函式模板

}//返回字串長度最大的地址

return

inarray[iindex];

}int

main()

;double

darray[4]=;

char*

carray[5]=;

//使用maxn函式計算個陣列,並輸出

cout<<"int

max:

"<

cout<<"double

max:

"<

cout<<"char*

max:

"<

return0;}

一道c++程式設計題 15

3樓:章氏不錯

point myp1(1,1),myp2(4,5); //定義point類的物件

cout<<"distance=";

cout<

第一句是用**定義點。你在前面加輸入4個數到double型的變數的**,然後放到1,1 ,4,5的位置就行了

一道c++程式設計題

4樓:璐人釔

#include

using namespace std;

#define pi 3.14

int main()

5樓:匿名使用者

#include

#define pi 3.14

using namespace std;

double cv(double r,double h)//體積計運算元函式

void show(double r,double h)//輸出子函式

一道c++程式設計題,求出e的值

6樓:匿名使用者

#include

#include

int main()

printf("%.10f", e);}

c++關於類的一道程式設計題。

7樓:倒黴熊

#include

using namespace std;

class rectangle

int calctotallength() // 計算周長函式int calcarea() // 計算面積函式// 設定長寬函式

void setwidth(int w)

void setlength(int l)};int main()

c++一道程式設計題(金額的讀法),求全部**

8樓:匿名使用者

隨手寫了一個,沒怎麼測,你試試吧

/*create by abacker on 12/04/2017[0,100000)金額讀法

*/#include

int main() ;

const int div = ;

int n;

scanf("%d", &n);

if (n == 0)

int quo;

bool zero = true;

for (int i = 0; i < 5; ++i)zero = true;

}if (quo > 0)

}printf("\n");

return 0;}

各位路過的大俠,一道c++程式設計題

9樓:君上沙夏

你看這樣能不能滿足你的需求:

#include

#include

#include

using namespace std;

#define n 1000  //定義陣列最大為1000;

class myarr{

public:

int a[n];

int len;

myarr(int b,int len){this->len=len;

for(int i=0;i

如有疑問可以追問!

10樓:

陣列名 是幹嘛的?

template

class cmyarray

cmyarray(t* temp,int sizetemp)}~cmyarray()

bool deleteit(int pos)//刪除某一位置size--;

return true;

}void deletesame()

}if(del)//標記沒有變化,說明沒找到,繼續往後找,++i; 有變化,不用++i;

++i;}}

void show()

看下 是這意思嗎?

求解一道C語言基礎程式設計題,一道C語言程式設計題求解

舉個例子你就懂了,以16進位制的2abc為例,16進位制轉為10進位制的方法,就是從右到左,依次用該位的數字乘以16的0次方 16的1次方 16的2次方 同樣如果是其它進位制,比如8進位制,那就是8的0次方 1次方等等 之和,比如說2abc轉10進位制,就等於 2abc 16 c 1 b 16 a ...

關於c 一道程式設計題,見下圖,一道C 程式設計題

include include class mystring char str size type thesize size type maxsize public mystring str nullptr thesize 0 maxsize 0 mystring const char s myst...

一道C語言程式設計題

include define maxnum 6 int main 這是從小到大排列 int num,i,j printf 輸入要插入的數 scanf d num if num在最前面 else if num a maxnum 2 插入的數大於或等於最後一個,插在最後面 a maxnum 1 num ...