HDU4891

#include//不要考虑{}¥相套的情况
#include//尽量找简便的思路,A了 
#include
#include  
#include 
#include  
#define large 1003
#define maxn 100000
using namespace std;
int n,flag,tip;
char str[large][5000];
__int64 time,result,space;
  int main()
  {
  
      while(scanf("%d\n",&n)!=EOF)//这里注意\n,而且要用__int64 
      {
          result=1;
          time=0;
          space=0;
          flag=0;
          for(int i=0;imaxn)//记得这么搞 
		     	break;
              }
            if(str[i][j]=='$'&&(flag==0))
            {
            space=2;
            flag=-1;
            continue;
            }
            if (flag == -1) //果然是我计算单一空格那里写搓了 
			{  
                if (str[i][j] ==' '&& str[i][j+1] ==' ')              
                    space++;      
                else if (str[i][j] ==' ')
				{  
                    result *= space;   
                    space= 2;  
                }  
                if(result>maxn)
                break;
            }
            if(str[i][j]=='$'&&(flag==-1))
            {
            flag=0;
            space=2;
            continue;
            }
          
          }  
          }
      
          if(result<=maxn)
          printf("%I64d\n",result);
          else
          printf("doge\n");
      
      }
      return 0;
  }

你可能感兴趣的:(模拟题)