C語言如何將int資料放到double小數部分?

時間 2021-06-09 17:10:11

1樓:醉臥沙場

不明白為什麼這種也要出來「拜神」…… 給你兩種方法,拿去交作業吧(有心就自己弄明白了再交,要是弄不明白就趁早轉乙個合適的專業)。

程式:// mytest.c

#include

#include

intmain

(int

argc

,char

*argv

)編譯,測試執行:

$ gcc -o mytest mytest.c -Wall

$ ./mytest 287664836289662

Current time is 287664836289662(us)

It's 287664836.289662(s)

Also you can see: it's 287664836.289662(s)

$ ./mytest 5000000

Current time is 5000000(us)

It's 5.000000(s)

Also you can see: it's 5.000000(s)

$ ./mytest 645

Current time is 645(us)

It's 0.000645(s)

Also you can see: it's 0.000645(s)

理論上,即使對於乙個初學者來說,學過C語言變數型別部分的內容後(一般在前兩章),就應該能按照第一種方式完成這個作業。

請問r語言中如何將資料分組

Winmin x rnorm 1000,0,1 x1 sort x,decreasing F for i in 1 10 a x1 1 i 1 100 i 100 print names table a which.max table a zhuobie 我說乙個比較簡單的辦法。將x1轉化為100 ...

C語言如何將小數轉化為分數,不用約分

Vukr 題主既然要求 不用約分 那看來就是想用下面這種方式來轉化了 這兩步可以這麼操作 include include intmain int molecule int molecule f printf f d d n num molecule denominator 約分 intmax int...

如何將json的資料轉化成csv的資料格式?

隨風潛夜 需求確認 將json資料轉化為csv的資料格式JSON可以有兩種格式,一種是物件格式的,另一種是陣列物件格式 物件格式 陣列物件格式 這裡介紹其中一種 陣列物件格式34 ttery min issue 20130801 3391 code 84529 code1 297734529 cod...