c 程式設計題目,c 程式設計題目

2021-05-14 08:17:27 字數 3968 閱讀 9736

1樓:旅初彤

因為字數限制,我就只寫方法,你自己寫實現的過程1.#include

using namespace std;

int fum(int n,int m)

for(i=n;i<=m;i++)

return sum;}2.

#include

using namespace std;

void area(double r1,double r2)}if(count>=2)else}4.

#include

using namespace std;

int maxgys(int numa,int numb)result=numa%numb;

while(result!=0)

return numb;

}int mingbs(int numa,int numb)

2樓:丿艾瑞灬莉婭

#include

using namespace std;

#define swap(a, b)

#define pi 3.1415926

#define p  1e-6

// 求和

int f(int n, int m)

// 圓環面積

double area(double r1, double r2)// 圓環周長

double length(double r1, double r2)

return x;

}// 最小公倍數

unsigned lcm(unsigned x, unsigned y)

int main(void)

3樓:匿名使用者

第1題#include stdio.h

int f(int n,int m);

void main()

int f(int n,int m)

c++程式設計題目!!!! 5

4樓:it圈新鮮事

結構體定義如下:

struct user;

5樓:匿名使用者

class user

6樓:跳跳的籃球

typedef struct

7樓:聽不清啊

struct user

c++程式設計題

8樓:匿名使用者

#include

#include

using namespace std;

struct student

s[7];

int main()

for(int i=0;i<5;i++)}

9樓:苦中作樂香蕉

#include

using namespace std;

const int n=5;

int ma***x;

double cunt=0;

struct student

friend istream &operator >>(istream &i,student &k)

} stu[n+1];

int main() {

for(int i=1; i<=n; i++)cin>>stu[i];

cout<<"平均分:"<

c++程式設計題目

10樓:匿名使用者

// 先做第一題:

class cstudent //基類在校人員的宣告

void input() // (2)一個輸入函式,用於鍵盤輸入學生的資訊;

void output( ) //輸出資料成員的函式(不含編號)};void main()

/// 第二題

class cshape

;class crectangle : public cshape;virtual float getarea() ;

virtual float getperimeter() ;

};#define pi 3.14

class ccirle : public cshape;virtual float getarea() ;

virtual float getperimeter() ;

};void main()

11樓:來自虎丘山穩重的海豹

只做一題吧 #include

#include

using namespace std;

class cstudent

int getid()// 獲取編號的函式void print( )//輸出資料成員的函式(不含編號)};void main( )

輸入還沒做

12樓:手機使用者

t;iostream>

using namespace std;

class riqi

;riqi::riqi()

;riqi::riqi(long snian,long syue,long sri)

;void riqi::set(long snian,long syue,long sri)

;void riqi::output()

;17.這裡是**。假設成員變數a,b為長整形。

class a

;class b:public a;

13樓:

#include

using namespace std;

//這是我改的程式 希望對你有所幫助

#include

using namespace std;

int palin(char *a)

int main()

c++程式設計題?

14樓:浪子_回頭

c++是在c的基礎上建立的,它比c的功能更強大,它是一門物件導向程式設計語言

15樓:姜心

輸入某年某月某日,判斷這一天是這一年的第幾天?

程式分析:以3月5日為例,應該先把前兩個月的加起來,然後再加上5天即本年的第幾天,特殊情況,閏年且輸入月份大於3時需考慮多加一天。

16樓:devil小豬蹄子

程式設計題挺難的,我無法為您解答,問一下你的老師吧?老師會為您解答的

17樓:

遇到c程式設計題,上傳到作業幫,然後就會出來答案,以及詳細的介紹了

18樓:英雄

你可以與程式設計老師好好**一下

c++ 程式設計題。。

19樓:匿名使用者

//以物件導向的方法設計一個類,此類包含3個私有資料:unlead,le

//ad(無鉛汽油和有鉛汽油)以及total(當天總收入,無鉛汽油的//**是17元/公升,有鉛汽油的**是16元/公升),請以建構函式方式建立此值。試輸入

//某天所加的汽油量,本程式將列出加油站當天的總收入。

#include

using namespace std;

const int unleadprice = 15, leadprice = 17;//

class station

~station(){}

double gettotal()

};void main()

20樓:匿名使用者

#include

using namespace std;

class gasoil

void compute(int ucnt, int cnt)

c語言程式設計題目求大神解答,C語言程式設計題目,求大神解答

include void main max array 0 min array 0 max number 0 min number 0 for i 0 i 10 i 找到最大值和最小值的位置if array i include define len 10 void fun arr int a,int...

幫忙《C語言程式設計》的題目,C語言程式設計幫忙答題

一.選擇題 1 若a是float型變數,b是unsigned型變數,以下輸入語句 a 是合法的。2 設以下變數均為int型別,則值不等於7的表示式是 c a x y 6,x y,x 1 b x y 6,x y,y 1 c x 6,x 1,y 6,x y d x 6,x 1,y x,y 1 3 設變數...

C語言題目求解答,C語言程式設計題目。求解答。

執行順序是這樣的,原因 a v1 0 所以 v1 0 if v1 不能執行,執行elsev2 0 所以if v2 不能執行 執行x 1 返回結果 1 先看第一個if語句,因為a 10,b 20,a 接著看b 20確實不等於15,b!15為真,所以也執行該if語句,在接下來看!v1,由於v1 5,v1...