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

我也不知道为啥output limited。why

Posted by 274856653 at 2021-03-30 17:03:38 on Problem 1566
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int n;
int isVowel(char x)
{
				if(x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u'||x == 'y')
								return 1;
				else
								return 0;
}

int isRight(char * str, int type)
{
				int i, tar, num = 0;
				int len = strlen(str);
				if(type == 1 )
								tar = 5;
				else
								tar = 7;
				for(i = 0; i<len; i++)
				{
								if(isVowel(str[i]))
								{
												num++;
												//printf("i = %d, str[i] = %c\n", i, str[i]);
												while(isVowel(str[i]))
												{
																i++;
												}
								}
				}
		//		printf("str = %s, type = %d, num = %d\n", str, type, num);
				return num;
}

int main()
{

				int i, j, k, len;
				int a, b, c;

				char *sep="//";
				char *p;

				char temp[1000];
				char str[500];
				while( 1 )
				{
								memset(temp, 0, sizeof(temp));
								a = 0, b = 0, c = 0;
								fgets(temp, 500, stdin);
								len = strlen(temp);
								temp[len-1] = '\0';
								len--;
								if(len == 0)
												continue;
								//printf("temp = %s, len = %d\n",  temp, len);
								//if( 0 == strcmp(temp, "e/o/i"))
								if(temp[0] == 'e' && temp[1] == '/' && temp[2] == 'o' &&temp[3] == '/'  && temp[4] == 'i')
								{
												break;
								}

								p = strtok(temp, sep);
								
								memset(str, 0, sizeof(str));
								sprintf(str, "%s", p);
							//	printf("str = %s\n", str);

								a = isRight(str, 1 );

								p = strtok(NULL, sep);
								memset(str, 0, sizeof(str));
								sprintf(str, "%s", p);
						//		printf("str = %s\n", str);
								b = isRight(str, 2 );

								p = strtok(NULL, sep);
								memset(str, 0, sizeof(str));
								sprintf(str, "%s", p);
							//	printf("str = %s\n", str);
								c = isRight(str, 1 );

								if(a != 5)
								{
												printf("1\n");
												continue;
								}
								if(b != 7)
								{
												printf("2\n");
												continue;
								}
								if(c != 5)
								{
												printf("3\n");
												continue;
								}
								printf("Y\n");
								




				}
}


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