Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

why? compile error

Posted by 1340502116 at 2015-07-25 12:05:31 on Problem 3096
#include <iostream> 
#include <cstring>
#include <map>
using namespace std;
const int N=100;
int main()
{	
	char s[N]={'\0'};
	
	while(cin>>s&&s[0]!='*')
	{
		int len=strlen(s);
		if(len<=2)
		{
			cout<<s<<" is surprising.\n";
		}
		else
		{
		
			bool sign;
			for(int d=1;d<=len-1;d++)
			{
				sign = true;
				map< string, bool > mark;
				for(int i=0;i<len-d;i++)
				{
					char sub[3]={s[i],s[i+d],'\0'};
					
					if(mark[sub]==true)
					{
						sign=false;
						break;
					}
					else
					{
						mark[sub]=true;
					}
				}
				
				if(!sign)
					break;
			}
			
			if(sign)
				cout<<s<<" is surprising.\n";
			else
				cout<<s<<" is NOT surprising.\n";
		}
	}
	
	return 0;
} 

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator