c語言最基礎的問題,請大神們幫幫忙,謝謝了

時間 2022-04-22 02:56:58

1樓:

第1題:

//#include "stdafx.h"//if the vc++6.0, with this line.

#include "stdio.h"

#include "math.h"

int main(void)

printf("the perimeter is %g\nthe area is %g\n",x+x+x,sqrt(3.0)/4*x*x);

return 0;

}第2題:

//#include "stdafx.h"//if the vc++6.0, with this line.

#include "stdio.h"

int main(void)

printf("%c <--> %c\n",ch,ch&0xdf);

return 0;

}第3題://感覺原題有歧義,以下求n,項數則是n的一半

//#include "stdafx.h"//if the vc++6.0, with this line.

#include "stdio.h"

int main(void)

第4題:

//#include "stdafx.h"//if the vc++6.0, with this line.

#include "stdio.h"

int main(void)

第5題:

//#include "stdafx.h"//if the vc++6.0, with this line.

#include "stdio.h"

int main(void)

x0=0,x1=x/2;

while((d=x1-x0)>=0 ? d>1.0e-6 : d<-1.0e-6)

x0=x1,x1=(x0+x/x0)/2;

printf("sqrt(%g)≈%g\n",x,x1);

return 0;

}第6題:

//#include "stdafx.h"//if the vc++6.0, with this line.

#include "stdio.h"

int main(void)

printf("\n");

return 0;

}第7題:

//#include "stdafx.h"//if the vc++6.0, with this line.

#include "stdio.h"

int myf(int n)

int main(void)

第8題:

//#include "stdafx.h"//if the vc++6.0, with this line.

#include "stdio.h"

double myf(int m)

int main(void)

第9題:

//#include "stdafx.h"//if the vc++6.0, with this line.

#include "stdio.h"

#include "math.h"

int main(void)

printf("\n");

return 0;

}第10題:

這你就自己弄吧!我的認識肯定與你的認識有差別……

2樓:匿名使用者

這些題都很簡單,你自己試著寫寫吧,練練水平

C語言求指點,C語言中很基礎的問題,求C語言大俠指點!!

a i 0 將 字元換成了 0 也就是說字串中沒有 字元 你後面for i 0 a i i 中的a i 根本不能成立。for迴圈會一直執行,直到偶爾在記憶體中碰到乙個 字元。陣列的大小只有100,超過100就越界了,所以會出現錯誤。因為你已經在a i 0 中把a i 賦 0 了 但是你在for迴圈中...

c語言關於指標的基礎問題,C語言關於指標的基礎知識

左邊傳遞的是數值,所以,形參不會對實參產生任何影響!右邊傳遞的是指標,而且,在swap 函式中,對指標中的資料進行了交換 變更 導致實參所對應的變數中的資料發生了變化。形象來說,傳指標到子函式,相當於把房間位址傳到子函式中,子函式根據房間位址,對房間中的物品進行處理。實際就是處理的實參對應的房間。關...

關於c語言基礎的問題要求解過程,關於C語言基礎的問題,要求解過程

1 012.2f 012表示前面輸出12位不足補0 2表示小數點後2位 000034213.69 2 b a 24 5 輸出是4.800000和4,a b 24 5輸出是4.00000和4,原因是執行順序是先右後左 1 輸出結果是000034213.69,共計12位,小數點後保留2位 2 b a 2...

大神求解,C語言問題,C語言的乙個題,大神求解!

include void scanf file 迴圈j次 後 並獲得合併的資料 存放到total num 寫資料 fclose fo 關閉檔案 fclose fi 至於你說的字串函式格式都是大同小異 無非就是 s d c 最長用的就是sprintf char path sprintf path,s ...

有關c語言程式相關基礎及提公升的問題

1 include是呼叫你在寫程式時所需要的程式包或者某個別的程式檔案,編譯肯定是連同呼叫的函式一起編譯,呼叫的函式越多程式就越大。2 eeprom具有掉電不丟失資料的作用,多用於掉電儲存資料。以前的微控制器自身rom不是很大,當編寫的程式比較大時,就要擴充套件eeprom來存放程式了 現在的微控制...