|
|
- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -
|
|
|
กระทู้ #3036 [C] (จาก IP: 124.120.88.157)
ช่วยแก้ warning ให้หน่อยค่ะ ติดอยู่ 1 ตัว
ติด warning อยู่ 1 ตัวอ่าค่ะ ของ c++<br>พอดีต้องส่งงานอ. แล้วอ.ไม่ให้ติด warning นะค่ะ <br>รบกวนหน่อยนะค่ะ ขอบคุณล่วงหน้าค่ะ<br><br><br><br><br>#include <stdio.h><br>#include <conio.h><br>void main()<br><br>{<br>char c,ch;<br>start : clrscr();<br>int menu;<br>int n1=0,n2=0,n3=0,n4=0,n5=0;<br>int money1=0,money2=0,money3=0,money4=0,money5=0;<br>long int money=0;<br><br>{<br>printf(\
|
จากคุณ
:
oom [2011-02-19 15:41:52]
|
|
ความคิดเห็น #28238 (จาก IP: 125.24.175.91)
post โค้ดใหม่หน่อยดีไหม๊ ไรเนี๋ย |
จากคุณ
:
maddog [2011-02-19 21:49:30]
|
|
ความคิดเห็น #28239 (จาก IP: 124.120.88.157)
#include <stdio.h> #include <conio.h> void main()
{ char c,ch; start : clrscr(); int menu; int n1=0,n2=0,n3=0,n4=0,n5=0; int money1=0,money2=0,money3=0,money4=0,money5=0; long int money=0;
{ printf("Enter your name : "); scanf ("%s","name"); printf("\n-------------------------- Menu Today -------------------------"); printf("\n| 1.Pizza 299 bath/price 4.Water 10 bath/price "); printf("\n| 2.Pasta 50 bath/price 5.Papsi 15 bath/price "); printf("\n| 3.Sandwich 30 bath/price "); printf("\n---------------------------------------------------------------"); printf("\n\nPlease selection menu\t:\t"); scanf("%d",&menu);
if(menu==1) { printf("How many : "); scanf("%d",&n1); money1=n1*299; money=money+money1; printf("Order pizza cost"); printf("unit=%d price= %d",n1,money1); printf("\n");
} else if(menu==2)
{ printf("How many : "); scanf("%d",&n2); money2=n2*50; money=money+money2; printf("Order Pasta cost"); printf("unit=%d price= %d",n2,money2); printf("\n");
}else if(menu==3)
{ printf("How many : "); scanf("%d",&n3); money3=n3*30; money=money+money3; printf("Order Sandwith cost"); printf("unit=%d price= %d",n3,money3); printf("\n");
}
else if(menu==4)
{ printf("How many : "); scanf("%d",&n4); money4=n4*10; money=money+money4; printf("Order Water cost"); printf("unit=%d price= %d",n4,money4); printf("\n");
}
else if(menu==5)
{ printf("How many : "); scanf("%d",&n5); money5=n5*15; money=money+money5; printf("Order Papsi cost"); printf("unit=%d price= %d",n5,money5); printf("\n"); }
}
{ printf("\nPress Y to do it again or Press N to exit the program : "); scanf("%s",&c); ch=getchar(); if( c=='y' ) goto start; else goto quit; quit :clrscr();
printf("Thank you!"); }
getch();
} |
จากคุณ
:
oom [2011-02-20 00:18:08]
|
|
ความคิดเห็น #28240 (จาก IP: 125.24.166.172)
เอา ch จากบรรทัด char c,ch; ออก เอา ch=getchar(); ออก
แล้วก็หาย จะมีไว้ทำอะไร ท่าจะไม่ได้เขียนเองหรือเปล่า |
จากคุณ
:
maddog [2011-02-20 02:12:20]
|
|
ความคิดเห็น #28241 (จาก IP: 124.122.137.4)
ขอบคุณมากๆเลยนะค่ะ ;D |
จากคุณ
:
oom [2011-02-20 15:09:17]
|
|
|
- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -
|
|
|
|
|