ใครเก่งภาษา C++ ช่วยหน่อยครับ

เมื่อ:
พุธ ต.ค. 08, 2008 23:24
โดย CR7Ronaldo
คือ อาจารย์ให้ทำ โปรเจ็คส่ง
มีใครเก่งพอจะเขียนเป็นมั้ยครับ
แบบเครื่องคิดเลข หรือเกมส์ไรก็ได้อ่ะครับ
ใครเก่งช่วยทีนะครับ ปกติที่ ม.ใช้ Turbo C++ 3
ใครเทพๆเก่งๆ ช่วยทีนะครับหรือมีลิงค์ให้ศึกษาก็ได้ครับ หา นานมากๆ ยังไมได้ไรเลย
ขอบคุณ

เมื่อ:
พุธ ต.ค. 08, 2008 23:40
โดย แมนยูอยู่ในสายเลือด
ผมก่อเรียนนะเทร์มที่ผ่านมานี้เอง สอบไปเมื่อวันจันที่ผ่านมาด้วย
ขอบอกเลย ยากมากเลยอ่ะ ทำไม่เป็น

เมื่อ:
พุธ ต.ค. 08, 2008 23:49
โดย manutd_girl_w
มีเครื่องคิดเลขแต่ใช้vbค่ะเพื่อนเคยส่งมาให้
c++นี่เขียนไม่ค่อยเป็นเลย
ยากมากค่ะ

เมื่อ:
พุธ ต.ค. 08, 2008 23:57
โดย CR7Ronaldo
งานเข้าแว้วววววว ฮือๆๆๆ
พระเจ้า อาเมน ช่วยลูกด้วย

เมื่อ:
พฤหัสฯ. ต.ค. 09, 2008 00:08
โดย CR7Ronaldo
#include"stdio.h"
#include"conio.h"
#include"dos.h"
#include"stdlib.h"
#include"string.h"
void DISPNUM(char *);
void main()
{
clrscr();
_setcursortype(0);
gotoxy(30,19);
textcolor(GREEN+BLINK);
cprintf("SIMPLE CALCULATOR");
gotoxy(50,21);
textcolor(BLUE+BLINK);
cprintf("By Rakesh Juyal");
getch();
// clrscr();
int x=30,y=10;
textcolor(WHITE);
gotoxy(x,y);
cprintf("7 8 9");
gotoxy(x,y+2);
cprintf("4 5 6");
gotoxy(x,y+4);
cprintf("1 2 3");
gotoxy(x,y+6);
cprintf("0");
textcolor(RED);
gotoxy(x+5,y+6);
cprintf(". =");
textcolor(GREEN);
x=x+15;
gotoxy(x,y);
cprintf("/");
gotoxy(x,y+2);
cprintf("*");
gotoxy(x,y+4);
cprintf("-");
gotoxy(x,y+6);
cprintf("+");
//Draw The For Calc//
x=28;y=5;
gotoxy(x,y);
textcolor(WHITE);
// ? & ? //
cprintf("%c",218);
gotoxy(28+20,y);
cprintf("%c",191);
// ? & ? //
//Horiz. Boundary
for(x=29;x<=28+19;x++)
{
gotoxy(x,y);
cprintf("%c",196);
gotoxy(x,y+12);
cprintf("%c",196);
}
//End of Horiz. Bound
// ? & ? //
cprintf("%c",217);
x=28;y=y+12;
gotoxy(x,y);
cprintf("%c",192);
//End of ? & ? //
//Vertic. Bound.
for(y=6;y<=16;y++)
{
gotoxy(x,y);
cprintf("%c",179);
gotoxy(x+20,y);
cprintf("%c",179);
}
//End of Vertic Bou.
y=6;
for(x=30;x<30>=200;i=i-50)
{
sound(i);
delay(100);
}
nosound();
break;
}
//Numeric//
if((ch>='0')&&(ch<='9'))
{
if(i<MAX)
{
if(first=='y')
{
operand1[i]=ch;
DISPNUM(operand1);
i++;
}
else
{
operand2[i]=ch;
DISPNUM(operand2);
i++;
}
}
else //More than 8 digit
{
ERROR=1;
}
}
else if(ch=='.')
{
if(first=='y')
{
if(strchr(operand1,'.')==NULL)
{
operand1[i]=ch;
i++;
}
DISPNUM(operand1);
}
else
{
if(strchr(operand2,'.')==NULL)
{
operand2[i]=ch;
i++;
}
DISPNUM(operand2);
}
}
//Non Numeric
else if (ch=='*')
{
operator1='*';
first='n';
i=0;
}
else if (ch=='/')
{
operator1='/';
first='n';
i=0;
}
else if (ch=='+')
{
operator1='+';
first='n';
i=0;
}
else if (ch=='-')
{
operator1='-';
first='n';
i=0;
}
else if ((ch=='=')||(ch=='
'))
{
//Store in Floating
if(strcmpi(operand1,BLANK)!=0)
{
num1=_atold(operand1);
}
if(strcmpi(operand2,BLANK)!=0)
{
num2=_atold(operand2);
}
//Now Calculate
switch (operator1)
{
case '+':
num1=num1+num2;
break;
case '-':
num1=num1-num2;
break;
case '*':
num1=num1*num2;
break;
case '/':
num1=num1/num2;
break;
}
//ltoa(num1,operand1,10);
gcvt(num1,12,operand1);
DISPNUM(operand1);
i=0;
first='y';
strcpy(operand1,BLANK);
strcpy(operand2,BLANK);
}
else //Invalid Choice
{
ERROR=1;
}
//Beep On ERROR else ------ //
if (ERROR==0)
{
sound(920);
}
else
{
sound(100);
ERROR=0;
}
delay(250);
nosound();
gotoxy(1,1);
cprintf("%d",i);
}while(1);
// clrscr();
gotoxy(30,19);
textcolor(GREEN+BLINK);
cprintf("SIMPLE CALCULATOR");
gotoxy(50,21);
textcolor(BLUE+BLINK);
cprintf("By Rakesh Juyal");
// getch();
}
void DISPNUM(char *num)
{
textbackground(RED);
gotoxy(31,7);
cprintf(" ");
gotoxy(31,7);
cprintf("%s",num);
}
ผมรันแล้วมันเออเร่ออ่ะครับ ใครรู้บ้างครับมันผิดยังไง
ตั้ง 6 ที่อ่ะครับ ฮือๆ ช่วยหน่อยน๊า

เมื่อ:
พฤหัสฯ. ต.ค. 09, 2008 00:19
โดย Crezendo
CR7Ronaldo เขียน:#include"stdio.h"
#include"conio.h"
#include"dos.h"
#include"stdlib.h"
#include"string.h"
void DISPNUM(char *);
void main()
{
clrscr();
_setcursortype(0);
gotoxy(30,19);
textcolor(GREEN+BLINK);
cprintf("SIMPLE CALCULATOR");
gotoxy(50,21);
textcolor(BLUE+BLINK);
cprintf("By Rakesh Juyal");
getch();
// clrscr();
int x=30,y=10;
textcolor(WHITE);
gotoxy(x,y);
cprintf("7 8 9");
gotoxy(x,y+2);
cprintf("4 5 6");
gotoxy(x,y+4);
cprintf("1 2 3");
gotoxy(x,y+6);
cprintf("0");
textcolor(RED);
gotoxy(x+5,y+6);
cprintf(". =");
textcolor(GREEN);
x=x+15;
gotoxy(x,y);
cprintf("/");
gotoxy(x,y+2);
cprintf("*");
gotoxy(x,y+4);
cprintf("-");
gotoxy(x,y+6);
cprintf("+");
//Draw The For Calc//
x=28;y=5;
gotoxy(x,y);
textcolor(WHITE);
// ? & ? //
cprintf("%c",218);
gotoxy(28+20,y);
cprintf("%c",191);
// ? & ? //
//Horiz. Boundary
for(x=29;x<=28+19;x++)
{
gotoxy(x,y);
cprintf("%c",196);
gotoxy(x,y+12);
cprintf("%c",196);
}
//End of Horiz. Bound
// ? & ? //
cprintf("%c",217);
x=28;y=y+12;
gotoxy(x,y);
cprintf("%c",192);
//End of ? & ? //
//Vertic. Bound.
for(y=6;y<=16;y++)
{
gotoxy(x,y);
cprintf("%c",179);
gotoxy(x+20,y);
cprintf("%c",179);
}
//End of Vertic Bou.
y=6;
for(x=30;x<30>=200;i=i-50)
{
sound(i);
delay(100);
}
nosound();
break;
}
//Numeric//
if((ch>='0')&&(ch<='9'))
{
if(i<MAX)
{
if(first=='y')
{
operand1[i]=ch;
DISPNUM(operand1);
i++;
}
else
{
operand2[i]=ch;
DISPNUM(operand2);
i++;
}
}
else //More than 8 digit
{
ERROR=1;
}
}
else if(ch=='.')
{
if(first=='y')
{
if(strchr(operand1,'.')==NULL)
{
operand1[i]=ch;
i++;
}
DISPNUM(operand1);
}
else
{
if(strchr(operand2,'.')==NULL)
{
operand2[i]=ch;
i++;
}
DISPNUM(operand2);
}
}
//Non Numeric
else if (ch=='*')
{
operator1='*';
first='n';
i=0;
}
else if (ch=='/')
{
operator1='/';
first='n';
i=0;
}
else if (ch=='+')
{
operator1='+';
first='n';
i=0;
}
else if (ch=='-')
{
operator1='-';
first='n';
i=0;
}
else if ((ch=='=')||(ch=='
'))
{
//Store in Floating
if(strcmpi(operand1,BLANK)!=0)
{
num1=_atold(operand1);
}
if(strcmpi(operand2,BLANK)!=0)
{
num2=_atold(operand2);
}
//Now Calculate
switch (operator1)
{
case '+':
num1=num1+num2;
break;
case '-':
num1=num1-num2;
break;
case '*':
num1=num1*num2;
break;
case '/':
num1=num1/num2;
break;
}
//ltoa(num1,operand1,10);
gcvt(num1,12,operand1);
DISPNUM(operand1);
i=0;
first='y';
strcpy(operand1,BLANK);
strcpy(operand2,BLANK);
}
else //Invalid Choice
{
ERROR=1;
}
//Beep On ERROR else ------ //
if (ERROR==0)
{
sound(920);
}
else
{
sound(100);
ERROR=0;
}
delay(250);
nosound();
gotoxy(1,1);
cprintf("%d",i);
}while(1);
// clrscr();
gotoxy(30,19);
textcolor(GREEN+BLINK);
cprintf("SIMPLE CALCULATOR");
gotoxy(50,21);
textcolor(BLUE+BLINK);
cprintf("By Rakesh Juyal");
// getch();
}
void DISPNUM(char *num)
{
textbackground(RED);
gotoxy(31,7);
cprintf(" ");
gotoxy(31,7);
cprintf("%s",num);
}
ผมรันแล้วมันเออเร่ออ่ะครับ ใครรู้บ้างครับมันผิดยังไง
ตั้ง 6 ที่อ่ะครับ ฮือๆ ช่วยหน่อยน๊า
มันยากจริง ผมซิ่วไปแหละ ของเค้าแรงC++

เมื่อ:
พฤหัสฯ. ต.ค. 09, 2008 00:34
โดย dracura
ส่งมะไหรอ่ะ
ทำไมถึงลกๆๆ ทำจังเลยคับ ....
ครื่อว่าผมจบมานานแล้ว จำคำสั่งมะค่อยได้ แต่ วิธีคิด อังกอ มันฝังอยู่ในหัว แต่รูปแบบคำสั่ง นี่จำมะค่อยได้อ่ะ
แต่ที่เขียนอ่ะคับ ทำไมเขียนแบบไฟล์เดียวให้รวบรัดเส็รจอ่ะคับ
ไม่แยกเปงไฟล์ๆๆอ่ะ จำคำสั่งมะได้แหะ แบบที่เขียนคำสั่งย่อยๆๆไว้ก่อนหลายๆๆคำสั่ง
แล้วค่อยใช้ทีละคำสั่งอ่ะ
อธิบายมะค่อยเปงสะด้วย ภาษา C นี่ถ้าไม่ทำความเข้าใจแต่แรกนี่ ลำบาก เรียนไงก็มะรู้เรื่องหรอก
ปล. ตอนเรียน มะเคยตกเลยสักครั้ง ได้คะแนนติด1-5 ของห้องตลอด ... ตอนเรียน ผ่านมะถึง10 นอกนั้นตกหมด ..
แต่จบมา2-3ปีมะเคยได้ใช้เลยสักนิด เหอๆๆๆ
ลองทิ้งเมลไว้สิมะแน่ อาจช่วยแนะนำได้ แต่จำคำสั่งมะค่อยได้จิงๆๆๆนะ แต่จะพยายามอธิบาย วิธีคิดให้ละกัน อาจพอช่วยได้....

เมื่อ:
พฤหัสฯ. ต.ค. 09, 2008 00:52
โดย CR7Ronaldo
ส่งอาจารย์ไปแล้วครับ ทาง Mail ผิดถูกเช่นไรแล้วแต่อาจารย์จะกรุณา อิอิ
5555+ ส่งปุ๊บ จารย์ Mail กลับมาเลย แหม๋ให้ส่งตั้งหลายวัน ไม่ส่ง
แล้วส่งช้ามากๆเลยนะ

เมื่อ:
พฤหัสฯ. ต.ค. 09, 2008 09:00
โดย Mr.SenGz
เพิ่งเรียนไปเอง..
แต่อยากบอกว่า
ลอกเพื่อนอย่างเดียว!
มันยากจริงๆ
%d - %.2f
งงเลย..

เมื่อ:
พฤหัสฯ. ต.ค. 09, 2008 12:05
โดย Grean_Size
ผมฟาด F มาเรียบร้อยแล้วครับ หึหึ