F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_19222150_8100.cpp: In function 'double deal(int, int, int)':
0_0_19222150_8100.cpp:12:18: error: expected ')' before 'char'
 #define eps 1e-8 char map[N][N];
                  ^
0_0_19222150_8100.cpp:19:168: note: in expansion of macro 'eps'
 double ans = 0; memset ( visit, 0, sizeof ( visit ) ); visit[ 0 ][ c ] = 1; for ( i = 0 ; i < n - 1 ; ++i ) {   for ( j = 0 ; j < m ; ++j ) {   if ( visit[ i ][ j ] > eps ) {    if ( map[ i ][ j ] != '.' ) {     ans += visit[ i ][ j ] * ( map[ i ][ j ] - '0' );    }    else {     if ( map[ i + 1 ][ j ] != '*' ) {       visit[ i + 1 ][ j ] += visit[ i ][ j ];     }     else {      if ( j > 0 ) {        visit[ i + 1 ][ j - 1 ] += visit[ i ][ j ] / 2;      }      if ( j < m - 1 ) {       visit[ i + 1 ][ j + 1 ] += visit[ i ][ j ] / 2;      }     }    }   }  } } for ( i = 0 ; i < m ; ++i ) {  if ( map[ n - 1 ][ i ] != '*' && map[ n - 1 ][ i ] != '.' ) {   ans += visit[ n - 1 ][ i ] * ( map[ n - 1 ][ i ] - '0' );  } } return ans;} 
                                                                                                                                                                        ^
0_0_19222150_8100.cpp:19:172: error: expected primary-expression before ')' token
 double ans = 0; memset ( visit, 0, sizeof ( visit ) ); visit[ 0 ][ c ] = 1; for ( i = 0 ; i < n - 1 ; ++i ) {   for ( j = 0 ; j < m ; ++j ) {   if ( visit[ i ][ j ] > eps ) {    if ( map[ i ][ j ] != '.' ) {     ans += visit[ i ][ j ] * ( map[ i ][ j ] - '0' );    }    else {     if ( map[ i + 1 ][ j ] != '*' ) {       visit[ i + 1 ][ j ] += visit[ i ][ j ];     }     else {      if ( j > 0 ) {        visit[ i + 1 ][ j - 1 ] += visit[ i ][ j ] / 2;      }      if ( j < m - 1 ) {       visit[ i + 1 ][ j + 1 ] += visit[ i ][ j ] / 2;      }     }    }   }  } } for ( i = 0 ; i < m ; ++i ) {  if ( map[ n - 1 ][ i ] != '*' && map[ n - 1 ][ i ] != '.' ) {   ans += visit[ n - 1 ][ i ] * ( map[ n - 1 ][ i ] - '0' );  } } return ans;} 
                                                                                                                                                                            ^
0_0_19222150_8100.cpp:19:602: error: 'map' was not declared in this scope
 double ans = 0; memset ( visit, 0, sizeof ( visit ) ); visit[ 0 ][ c ] = 1; for ( i = 0 ; i < n - 1 ; ++i ) {   for ( j = 0 ; j < m ; ++j ) {   if ( visit[ i ][ j ] > eps ) {    if ( map[ i ][ j ] != '.' ) {     ans += visit[ i ][ j ] * ( map[ i ][ j ] - '0' );    }    else {     if ( map[ i + 1 ][ j ] != '*' ) {       visit[ i + 1 ][ j ] += visit[ i ][ j ];     }     else {      if ( j > 0 ) {        visit[ i + 1 ][ j - 1 ] += visit[ i ][ j ] / 2;      }      if ( j < m - 1 ) {       visit[ i + 1 ][ j + 1 ] += visit[ i ][ j ] / 2;      }     }    }   }  } } for ( i = 0 ; i < m ; ++i ) {  if ( map[ n - 1 ][ i ] != '*' && map[ n - 1 ][ i ] != '.' ) {   ans += visit[ n - 1 ][ i ] * ( map[ n - 1 ][ i ] - '0' );  } } return ans;} 
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ^
0_0_19222150_8100.cpp: In function 'int main()':
0_0_19222150_8100.cpp:22:133: error: 'map' was not declared in this scope
 double ans, temp; scanf ( "%d", &t ); while ( t-- ) {  scanf ( "%d%d", &n, &m );  getchar();  for ( i = 0 ; i < n ; ++i ) {   gets( map[ i ] );   if ( map[ i ][ 0 ] == '\0' ) --i;  }  ans = 0;  for ( i = 0 ; i < m ; ++i ) {   if ( map[ 0 ][ i ] != '.' ) {     if ( map[ 0 ][ i ] == '*' ) temp = 0;    else temp = map[ 0 ][ i ] - '0';   }   else temp = deal( i, n, m );    if ( temp - ans > eps ) ans = temp;  }     printf ( "%.6lf\n", ans );     }     return 0;}
                                                                                                                                     ^
0_0_19222150_8100.cpp:22:232: error: 'map' was not declared in this scope
 double ans, temp; scanf ( "%d", &t ); while ( t-- ) {  scanf ( "%d%d", &n, &m );  getchar();  for ( i = 0 ; i < n ; ++i ) {   gets( map[ i ] );   if ( map[ i ][ 0 ] == '\0' ) --i;  }  ans = 0;  for ( i = 0 ; i < m ; ++i ) {   if ( map[ 0 ][ i ] != '.' ) {     if ( map[ 0 ][ i ] == '*' ) temp = 0;    else temp = map[ 0 ][ i ] - '0';   }   else temp = deal( i, n, m );    if ( temp - ans > eps ) ans = temp;  }     printf ( "%.6lf\n", ans );     }     return 0;}
                                                                                                                                                                                                                                        ^
0_0_19222150_8100.cpp:12:18: error: expected ')' before 'char'
 #define eps 1e-8 char map[N][N];
                  ^
0_0_19222150_8100.cpp:22:391: note: in expansion of macro 'eps'
 double ans, temp; scanf ( "%d", &t ); while ( t-- ) {  scanf ( "%d%d", &n, &m );  getchar();  for ( i = 0 ; i < n ; ++i ) {   gets( map[ i ] );   if ( map[ i ][ 0 ] == '\0' ) --i;  }  ans = 0;  for ( i = 0 ; i < m ; ++i ) {   if ( map[ 0 ][ i ] != '.' ) {     if ( map[ 0 ][ i ] == '*' ) temp = 0;    else temp = map[ 0 ][ i ] - '0';   }   else temp = deal( i, n, m );    if ( temp - ans > eps ) ans = temp;  }     printf ( "%.6lf\n", ans );     }     return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                       ^
0_0_19222150_8100.cpp:22:395: error: expected primary-expression before ')' token
 double ans, temp; scanf ( "%d", &t ); while ( t-- ) {  scanf ( "%d%d", &n, &m );  getchar();  for ( i = 0 ; i < n ; ++i ) {   gets( map[ i ] );   if ( map[ i ][ 0 ] == '\0' ) --i;  }  ans = 0;  for ( i = 0 ; i < m ; ++i ) {   if ( map[ 0 ][ i ] != '.' ) {     if ( map[ 0 ][ i ] == '*' ) temp = 0;    else temp = map[ 0 ][ i ] - '0';   }   else temp = deal( i, n, m );    if ( temp - ans > eps ) ans = temp;  }     printf ( "%.6lf\n", ans );     }     return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                           ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-29 01:21:57, Gzip enabled