29-12-2006, 18:06
|
|
|
חבר מתאריך: 28.05.06
הודעות: 31
|
|
עזרה ב-c
ניסיתי לעשות ב-c משהו שמחשב את החציון של שלושה מספרים כתבתי את זה:
קוד PHP:
#include <stdio.h> #include <conio.h> int main() { double a, b, c, avg, t; int x; printf("Please enter 3 numbers:"); scanf("%lf%lf%lf", &a, &b, &c); avg = ( a + b + c) ; t=avg/2; if("%if = %d",&t, &x) { printf("%lf", &t); } else if("%lf =! %d", t, x) { printf("%lf", &t); } getch(); return 0; }
כל פעם זה מראה לי שהחציון הוא אפס, מה לא טוב פה? תודה לעוזרים
_____________________________________
|