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

main&mian...........................

Posted by frkstyc at 2005-09-20 15:21:58 on Problem 1936
In Reply To:为什么这程序在Link时候通不过! Posted by:lbcharry at 2005-09-20 14:45:23
> #include <iostream>
> #include <string.h>
> #include <math.h>
> 
> using namespace std;
> 
> //const int N=100001;
> 
> char sub[101];
> char str[101];
> 
> int len1;
> int len2;
> 
> int mian()
> {
> 	int i,j;
> 	int equalNum;
> 
> 	while(cin>>sub)
> 	{
> 		cin>>str;
> 		equalNum=0;
> 		len1=(int)strlen(sub);
> 		len2=(int)strlen(str);
> 
> 		i=0;j=0;
> 		for(i=0; i<len1; i++)
> 		{
>              while(j<len2&&str[j]!=sub[i])
> 				 j++;
>               if(j<len2)
> 			  {
> 				  equalNum++;
> 				  j++;
> 			  }
> 		}
> 		if(equalNum==len1)
> 		{
> 			cout<<"Yes\n";
> 		}
> 		else
> 		{
> 			cout<<"No\n";
> 		}
> 	}
> 
> 	return 0;
> }
>  LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
> Debug/1936.exe : fatal error LNK1120: 1 unresolved externals
> Error executing link.exe.
> 
> 1936.exe - 2 error(s), 0 warning(s)

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