
02-12-2005, 18:44
|
|
|
|
חבר מתאריך: 22.08.05
הודעות: 54
|
|
|
יש לי בעיה בשפת c אני צריך עזרה דחוף
אני משתמש ב visual c++ 2005 express edition
אני ממש מתחיל בזה (3 שיעורים)
וביקשו ממני לכתוב תוכנית שתקבל x מספרים ותדפיס את הגדול ביותר מביניהם
עכשיו אני כמעט בטוח שעשיתי נכון ואין לי מושג מה הטעות
קוד:
#include<iostream>
void main()
{
int max=0, num1 ;
cout<<"Insert numbers, exit with 0: \n";
cin>>num1;
while(num1!=0)
{
if(num1>max)
{
max=max-max+num1;
}
else
{
max=max;
}
}
cout<<max<<"\n";
}
קוד:
אני מקבל 2 שגיאות
------ Build started: Project: 133, Configuration: Debug Win32 ------
Compiling...
Source1.cpp
c:\documents and settings\*****\my documents\visual studio 2005\projects\source1.cpp(7) : error C2065: 'cout' : undeclared identifier
c:\documents and settings\*****\my documents\visual studio 2005\projects\source1.cpp(8) : error C2065: 'cin' : undeclared identifier
133 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
בבקשה תעזרו לי
איפה הטעות?
נערך לאחרונה ע"י The_Jokerr בתאריך 02-12-2005 בשעה 18:56.
|