ตามหัวข้อกระทู้เลยครับ พอดีผมเข้ามาเรียน ปวส. เข้ามาจารย์ก็ให้งานทำโดยที่สอนโฟลวชาร์ตของโปรแกรมอีกแบบนึงซึ่งผมแทบจะไม่มีพื้นฐานเลยเรื่องนี้ ผมเรียนสายตรงมานะครับ แต่ตอน ปวช. ผมคิดซะแค่ว่าก็อบส่งๆไปก็ได้คะแนนแล้ว แต่มาเจอตอน ปวส. นี่ยิ่งหนักครับ ผมอยากทำเป็นแล้ว แต่ผมยังจับทางมันไม่ได้กับ ภาษานี้ หาอ่านหลายเว็บแล้วแต่ก็ยังทำโค๊ดที่อาจารย์ให้มาไม่ได้ เลยอยากให้พวกพี่ๆช่วยแปลงให้หน่อยครับ เห็นตัวอย่างสักอันแล้วผมก็คงลื่นไหลแล้วหล่ะครับ ขอบคุณครับ
#include<iosteam>
using namespace std;
int main(){
int x = 1234567890;
cout <<"Original \t Out Put by defaul" endl;
cout <<"1234567890 \t: " << x << endl;
bool b=1;
cout << " 1\t\t: " << b << b endl;
double d0 = 0.123456;
double d1 = 123.0;
double d2 = 5.142857142E00;
cout << "0.123456 \t: " << d0 << endl;
cout << "123.0 \t\t: " << d1 << endl;
cout << "-0.1234567 \t: "<< d1 - 123.1234567 << endl;
cout << "1234567890 \t: " << d2 << endl;
cout << "5.142857142E22 \t: " << d3 endl;
}
ไม่ทราบว่าผมเข้าใจถูกมั้ยครับ ช่วยแนะนำทีนะครับ ผิดตรงไหน
(start)
|
/ x=1234567890 /
|
< "Original \t Output by default" )
|
< "1234567890 \t:" )
| endl; |
|
/ b = 1 /
|
< "1\t\t:" b )
|
< "0\t\t:" !b )
|
| endl |
|
/ d0 = 0.123456 /
|
( stop )
ช่วยแปลงโค๊ดเป็นโฟลวชาร์ตตัวอย่างหน่อยครับ
#include<iosteam>
using namespace std;
int main(){
int x = 1234567890;
cout <<"Original \t Out Put by defaul" endl;
cout <<"1234567890 \t: " << x << endl;
bool b=1;
cout << " 1\t\t: " << b << b endl;
double d0 = 0.123456;
double d1 = 123.0;
double d2 = 5.142857142E00;
cout << "0.123456 \t: " << d0 << endl;
cout << "123.0 \t\t: " << d1 << endl;
cout << "-0.1234567 \t: "<< d1 - 123.1234567 << endl;
cout << "1234567890 \t: " << d2 << endl;
cout << "5.142857142E22 \t: " << d3 endl;
}
ไม่ทราบว่าผมเข้าใจถูกมั้ยครับ ช่วยแนะนำทีนะครับ ผิดตรงไหน
(start)
|
/ x=1234567890 /
|
< "Original \t Output by default" )
|
< "1234567890 \t:" )
| endl; |
|
/ b = 1 /
|
< "1\t\t:" b )
|
< "0\t\t:" !b )
|
| endl |
|
/ d0 = 0.123456 /
|
( stop )