读书人

VS2008下 小程序报错,该如何处理

发布时间: 2012-04-04 16:38:51 作者: rapoo

VS2008下 小程序报错

C/C++ code
#include<iostream>const int ArSize = 6;int main(){   using namespace std;   float  naaq[ArSize];   cout << "Enter the NAAQs (Now Age Awareness Quotients)"        << "of\nyour neighbors program terminates"        << "when you make\n" << ArSize << "entries"        << "or enter a negtive values\n";   int i = 0;   float Temp;   cout << "First values : ";   cin >> Temp;   while (i < ArSize && Temp >= 0)       (          naaq[i] = Temp;          ++i;          if(i < ArSize)              (                  cout << "Next values : ";                  cin >>Temp;                             )       )      if(i == 0)         cout << "No date-bye\n";      else          (             cout << "Enter your NAAQ:";             float you;             cin >> you;             int count = 0;             for(int j = 0;j < i;j++)                 if(naaq[j] > you)                     ++count;              cout << count;              cout << "of you neighbors have greater awareness of\n"                   << "the New Age than you do\n";          )         return 0;}



C/C++ code
1>andtest.cpp1>e:\teststation\andtest\andtest\andtest.cpp(19) : error C2143: 语法错误 : 缺少“)”(在“;”的前面)1>e:\teststation\andtest\andtest\andtest.cpp(23) : error C2143: 语法错误 : 缺少“)”(在“;”的前面)1>e:\teststation\andtest\andtest\andtest.cpp(25) : error C2059: 语法错误 : “)”1>e:\teststation\andtest\andtest\andtest.cpp(27) : error C2059: 语法错误 : “)”1>e:\teststation\andtest\andtest\andtest.cpp(32) : error C2143: 语法错误 : 缺少“)”(在“;”的前面)1>e:\teststation\andtest\andtest\andtest.cpp(43) : error C2059: 语法错误 : “)”



我看几遍了没找出来! 帮帮忙……

[解决办法]
while (i < ArSize && Temp >= 0)
(
应该是{
[解决办法]
就是括号问题:
while (i < ArSize && Temp >= 0)
{

}

还有 if()
{


}
else {

}


多写写就好了!

读书人网 >C++

热点推荐