程式設計題 急 下午補考

2025-01-25 18:25:11 字數 1733 閱讀 5589

1樓:網友

#include

#include

void swap(int* a, int* b)int temp = a;

a = b;

b = temp;

void reverse(int* beg, int* end)int n = end - beg)/2;

while(n-- 0)

swap(beg++,end);

int main()

int a[3], i = 0;

double x = 0, y = 0;

printf("輸入3個數: "

while(i < 3)

scanf("%d", a[i++]

reverse(a, a + sizeof a/sizeof a[0]);反序 */

for(i = 0; i < 3; +i)printf("%d ",a[i]);

printf("輸入x: "

scanf("%lf", x);

y = x < 0 ? abs(x) :x >=0 &&x < 4 ? pow(x + 2, 3) :2 * x + 5);

printf("y的值為: %2lf", y);

補考啊,幫幫忙c++程式設計題

2樓:早行x遠客

給個郵箱,給你發點此類的資料,c程式設計的經典例子。

同志們!!!c++程式設計題!!!下午交。!!**等。。。。急啊 。。。。。拜託了啊!!

3樓:暢景彰

這是你要的兩個程式,我vc6通過除錯執行了。

#include

using namespace std;

void main()

sample()

void main()

4樓:網友

1以上的方法比較老套,給你乙個遞迴函式,這是參考資料都很難找到的。

a:是待排序陣列,n:資料個數。

void bubble(int a,int n)~sample()

void main()

這題程式設計題怎麼做

5樓:woailuo帥

len是長度吧,=11

instr是判斷s在x第一次出現的位置,從3開始,所以=8.答案是c

程式設計題,

6樓:woailuo帥

。。。完全不聽課的學渣嗎。

public class dog extends animal{帶皮絕 public dog(){

name=""

public dog(string name){;

public void speak(){

旺旺");public class test{

public void main(){

dog[5] dog={

dog("哈哈");

握森 dog("嘻嘻");

dog("呵呵");

蠢姿 dog("嘿嘿");

dog("嚯嚯");

dog[0].speak();

dog[1].speak();

dog[2].speak();

dog[3].speak();

dog[4].speak();

急求簡單c 程式設計題答案,急 !!求簡單C 程式設計題答案

class shape shape virtual float getarea 0 定義純虛擬函式 virtual float getperim 0 class rectangle public shape rectangle float getarea float getperim define ...

求高手!Java程式設計題急

1.public class circle public circle int r 直徑 public int getzhijing 面積 public int getmianji 周長 public int getzhouchang 2.public class personpublic void...

c語言程式設計題,C語言程式設計題

首先分析問題 bai重複du輸出同一類語句肯定要用迴圈,zhi有關判斷肯dao定要用分支回。所以解決這個問題就是在一個答迴圈 用於重複讀取資料和輸出 裡面套一個分支語句 判斷密碼是數字還是字母 具體 include include include main else printf error n s...