Error[8]: Undefined offset: 61, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 114
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

[+++]

[+++]

[+++]

[+++]

[+++]

[+++]

[+++] [+++]

[+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] 这题我重写了四遍......(太菜了我) 题意是判断abb式的名字。


列出思路(参考了@小小小why同学的思路与代码): ZCMU--1516: Name(C语言)_小小小Why的博客-CSDN博客 1.找到首字母所在位置(利用一个数组存储该字母位置) 2.通过首字母位置存储姓氏和名字 3.利用strcmp对字符串进行比较判断是不是abb型的名字 我掉的坑: 1.不是简单把大写字母提取出来判断 2.数组没开够出现了:A Not allowed system call: runid:653257 :使用了系统禁止的 *** 作系统调用,看看是否越权访问了文件或进程等资源 3.对于char数组要对每个单位逐个进行初始化(’\0‘)  4.数组元素尽量一对一进行判断,少利用前后关系(例如a[i]和a[i-1]),这样容易出现边界问题 wa代码①(想问题太简单)

#include

int main()
{
	char a[20];
	char b[3];
	int i,n,j,k=0;
	
	while(scanf("%d",&n)!=EOF)
	{
		for(i=1;i<=n;i++)
		{
			scanf("%s",a);
			
				for(j=0;j='A'&&a[j]<='Z')
					{
						b[k]=a[j];
						k++;
					}
				}
				if(b[0]!=b[1]&&b[1]==b[2])
				printf("Yes\n");
				else
				printf("No\n");
			
		}
	}
	return 0;
}
wa代码②(利用前后关系,样例是对的,但是在“XuXuXu”这个例子上存储出错了)
#include
using namespace std;
int main()
{
	char x[30],y[5];
	char a[10],b[10],c[10];
	int n,i,j;
	cin>>n;
	while(n--)
	{
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		memset(c,0,sizeof(c));
		memset(x,0,sizeof(x));
		
		cin>>x;
		j=0;
		int flag=0;
		for(i=0;i<=strlen(x);i++)
		{
			if(isupper(x[i]))
			y[j++]=x[i];
		}
		
		for(i=0;i

wa代码③ (对于char数组的初始化需要逐个赋’\0‘ 否则在strcmp会出错)
 
 #include
using namespace std;
int main()
{
	char x[200];
	char a[100],b[100],c[100];
	int po[4];
	int n,i,j;
	cin>>n;
	while(n--)
	{
		 a[10]='\0',b[10]='\0',c[10]='\0';

		memset(po,0,sizeof(po));
		
		cin>>x;
		j=0;
		for(i=0;i<='Z')
			po[j++]=i;	
		}
		j=0;
		for(i=po[0];i='A'&&x[i]

AC代码(参考过@小小小why同学的代码)
 
 #include<100;i++)//逐个进行初始化 
		a[i]='',b[i]='<='Z')
			po[j++]=i;	//利用数组存储大写字母位置 
		}
		j=0;
		for(i=0;i',c[i]='
'; memset(po,0,sizeof(po)); cin> using namespace std; int main() { char x[200]; char a[100],b[100],c[100]; int po[4]; int n,i,j; cin>>n; while(n--) { for(i=0;i

>x; j=0; for(i=1;i

='A'&&x[i]<===><===> <===><===>)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 62, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 114
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

[+++]

[+++]

[+++]

[+++]

[+++]

[+++]

[+++] [+++]

[+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] 这题我重写了四遍......(太菜了我) 题意是判断abb式的名字。


列出思路(参考了@小小小why同学的思路与代码): ZCMU--1516: Name(C语言)_小小小Why的博客-CSDN博客 1.找到首字母所在位置(利用一个数组存储该字母位置) 2.通过首字母位置存储姓氏和名字 3.利用strcmp对字符串进行比较判断是不是abb型的名字 我掉的坑: 1.不是简单把大写字母提取出来判断 2.数组没开够出现了:A Not allowed system call: runid:653257 :使用了系统禁止的 *** 作系统调用,看看是否越权访问了文件或进程等资源 3.对于char数组要对每个单位逐个进行初始化(’\0‘)  4.数组元素尽量一对一进行判断,少利用前后关系(例如a[i]和a[i-1]),这样容易出现边界问题 wa代码①(想问题太简单)

#include

int main()
{
	char a[20];
	char b[3];
	int i,n,j,k=0;
	
	while(scanf("%d",&n)!=EOF)
	{
		for(i=1;i<=n;i++)
		{
			scanf("%s",a);
			
				for(j=0;j='A'&&a[j]<='Z')
					{
						b[k]=a[j];
						k++;
					}
				}
				if(b[0]!=b[1]&&b[1]==b[2])
				printf("Yes\n");
				else
				printf("No\n");
			
		}
	}
	return 0;
}
wa代码②(利用前后关系,样例是对的,但是在“XuXuXu”这个例子上存储出错了)
#include
using namespace std;
int main()
{
	char x[30],y[5];
	char a[10],b[10],c[10];
	int n,i,j;
	cin>>n;
	while(n--)
	{
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		memset(c,0,sizeof(c));
		memset(x,0,sizeof(x));
		
		cin>>x;
		j=0;
		int flag=0;
		for(i=0;i<=strlen(x);i++)
		{
			if(isupper(x[i]))
			y[j++]=x[i];
		}
		
		for(i=0;i

wa代码③ (对于char数组的初始化需要逐个赋’\0‘ 否则在strcmp会出错)
 
 #include
using namespace std;
int main()
{
	char x[200];
	char a[100],b[100],c[100];
	int po[4];
	int n,i,j;
	cin>>n;
	while(n--)
	{
		 a[10]='\0',b[10]='\0',c[10]='\0';

		memset(po,0,sizeof(po));
		
		cin>>x;
		j=0;
		for(i=0;i<='Z')
			po[j++]=i;	
		}
		j=0;
		for(i=po[0];i='A'&&x[i]

AC代码(参考过@小小小why同学的代码)
 
 #include<100;i++)//逐个进行初始化 
		a[i]='',b[i]='<='Z')
			po[j++]=i;	//利用数组存储大写字母位置 
		}
		j=0;
		for(i=0;i',c[i]='
'; memset(po,0,sizeof(po)); cin> using namespace std; int main() { char x[200]; char a[100],b[100],c[100]; int po[4]; int n,i,j; cin>>n; while(n--) { for(i=0;i

>x; j=0; for(i=1;i

='A'&&x[i]<===> <===><===>)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 63, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 114
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

[+++]

[+++]

[+++]

[+++]

[+++]

[+++]

[+++] [+++]

[+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] 这题我重写了四遍......(太菜了我) 题意是判断abb式的名字。


列出思路(参考了@小小小why同学的思路与代码): ZCMU--1516: Name(C语言)_小小小Why的博客-CSDN博客 1.找到首字母所在位置(利用一个数组存储该字母位置) 2.通过首字母位置存储姓氏和名字 3.利用strcmp对字符串进行比较判断是不是abb型的名字 我掉的坑: 1.不是简单把大写字母提取出来判断 2.数组没开够出现了:A Not allowed system call: runid:653257 :使用了系统禁止的 *** 作系统调用,看看是否越权访问了文件或进程等资源 3.对于char数组要对每个单位逐个进行初始化(’\0‘)  4.数组元素尽量一对一进行判断,少利用前后关系(例如a[i]和a[i-1]),这样容易出现边界问题 wa代码①(想问题太简单)

#include

int main()
{
	char a[20];
	char b[3];
	int i,n,j,k=0;
	
	while(scanf("%d",&n)!=EOF)
	{
		for(i=1;i<=n;i++)
		{
			scanf("%s",a);
			
				for(j=0;j='A'&&a[j]<='Z')
					{
						b[k]=a[j];
						k++;
					}
				}
				if(b[0]!=b[1]&&b[1]==b[2])
				printf("Yes\n");
				else
				printf("No\n");
			
		}
	}
	return 0;
}
wa代码②(利用前后关系,样例是对的,但是在“XuXuXu”这个例子上存储出错了)
#include
using namespace std;
int main()
{
	char x[30],y[5];
	char a[10],b[10],c[10];
	int n,i,j;
	cin>>n;
	while(n--)
	{
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		memset(c,0,sizeof(c));
		memset(x,0,sizeof(x));
		
		cin>>x;
		j=0;
		int flag=0;
		for(i=0;i<=strlen(x);i++)
		{
			if(isupper(x[i]))
			y[j++]=x[i];
		}
		
		for(i=0;i

wa代码③ (对于char数组的初始化需要逐个赋’\0‘ 否则在strcmp会出错)
 
 #include
using namespace std;
int main()
{
	char x[200];
	char a[100],b[100],c[100];
	int po[4];
	int n,i,j;
	cin>>n;
	while(n--)
	{
		 a[10]='\0',b[10]='\0',c[10]='\0';

		memset(po,0,sizeof(po));
		
		cin>>x;
		j=0;
		for(i=0;i<='Z')
			po[j++]=i;	
		}
		j=0;
		for(i=po[0];i='A'&&x[i]

AC代码(参考过@小小小why同学的代码)
 
 #include<100;i++)//逐个进行初始化 
		a[i]='',b[i]='<='Z')
			po[j++]=i;	//利用数组存储大写字母位置 
		}
		j=0;
		for(i=0;i',c[i]='
'; memset(po,0,sizeof(po)); cin> using namespace std; int main() { char x[200]; char a[100],b[100],c[100]; int po[4]; int n,i,j; cin>>n; while(n--) { for(i=0;i

>x; j=0; for(i=1;i

='A'&&x[i] <===><===>)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
Error[8]: Undefined offset: 64, File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 114
File: /www/wwwroot/outofmemory.cn/tmp/plugin_ss_superseo_model_superseo.php, Line: 473, decode(

[+++]

[+++]

[+++]

[+++]

[+++]

[+++]

[+++] [+++]

[+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] [+++] 这题我重写了四遍......(太菜了我) 题意是判断abb式的名字。


列出思路(参考了@小小小why同学的思路与代码): ZCMU--1516: Name(C语言)_小小小Why的博客-CSDN博客 1.找到首字母所在位置(利用一个数组存储该字母位置) 2.通过首字母位置存储姓氏和名字 3.利用strcmp对字符串进行比较判断是不是abb型的名字 我掉的坑: 1.不是简单把大写字母提取出来判断 2.数组没开够出现了:A Not allowed system call: runid:653257 :使用了系统禁止的 *** 作系统调用,看看是否越权访问了文件或进程等资源 3.对于char数组要对每个单位逐个进行初始化(’\0‘)  4.数组元素尽量一对一进行判断,少利用前后关系(例如a[i]和a[i-1]),这样容易出现边界问题 wa代码①(想问题太简单)

#include

int main()
{
	char a[20];
	char b[3];
	int i,n,j,k=0;
	
	while(scanf("%d",&n)!=EOF)
	{
		for(i=1;i<=n;i++)
		{
			scanf("%s",a);
			
				for(j=0;j='A'&&a[j]<='Z')
					{
						b[k]=a[j];
						k++;
					}
				}
				if(b[0]!=b[1]&&b[1]==b[2])
				printf("Yes\n");
				else
				printf("No\n");
			
		}
	}
	return 0;
}
wa代码②(利用前后关系,样例是对的,但是在“XuXuXu”这个例子上存储出错了)
#include
using namespace std;
int main()
{
	char x[30],y[5];
	char a[10],b[10],c[10];
	int n,i,j;
	cin>>n;
	while(n--)
	{
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		memset(c,0,sizeof(c));
		memset(x,0,sizeof(x));
		
		cin>>x;
		j=0;
		int flag=0;
		for(i=0;i<=strlen(x);i++)
		{
			if(isupper(x[i]))
			y[j++]=x[i];
		}
		
		for(i=0;i

wa代码③ (对于char数组的初始化需要逐个赋’\0‘ 否则在strcmp会出错)
 
 #include
using namespace std;
int main()
{
	char x[200];
	char a[100],b[100],c[100];
	int po[4];
	int n,i,j;
	cin>>n;
	while(n--)
	{
		 a[10]='\0',b[10]='\0',c[10]='\0';

		memset(po,0,sizeof(po));
		
		cin>>x;
		j=0;
		for(i=0;i<='Z')
			po[j++]=i;	
		}
		j=0;
		for(i=po[0];i='A'&&x[i]

AC代码(参考过@小小小why同学的代码)
 
 #include<100;i++)//逐个进行初始化 
		a[i]='',b[i]='<='Z')
			po[j++]=i;	//利用数组存储大写字母位置 
		}
		j=0;
		for(i=0;i',c[i]='
'; memset(po,0,sizeof(po)); cin> using namespace std; int main() { char x[200]; char a[100],b[100],c[100]; int po[4]; int n,i,j; cin>>n; while(n--) { for(i=0;i

>x; j=0; for(i=1;i

='A'&&x[i] <===>)
File: /www/wwwroot/outofmemory.cn/tmp/route_read.php, Line: 126, InsideLink()
File: /www/wwwroot/outofmemory.cn/tmp/index.inc.php, Line: 166, include(/www/wwwroot/outofmemory.cn/tmp/route_read.php)
File: /www/wwwroot/outofmemory.cn/index.php, Line: 30, include(/www/wwwroot/outofmemory.cn/tmp/index.inc.php)
[ZCMUOJ]1516: Name_C_内存溢出

[ZCMUOJ]1516: Name

[ZCMUOJ]1516: Name,第1张

Description

        There was a boy called ZDD, and he loved a girl whose name is SZD. They loved each other deeply. After saving SZD from TIANKENG, they led a happy life. And later they had a son, and choosing name of their son was a big problem. ZDD was very like “ABB” style. For example, “ZhaoDongDong” is a “ABB” style name, and “ChenLiJian” is not. Then ZDD wanted to know if a name was “ABB” style or not?

Note that A and B should be different!

Input

The first line is an integer T, which indicates the number of test case.

For each test case, there is a string S, which indicates the name of their son. The length of the string is not more than 100. The first letter of every word will be capital.Besides, the name string only contains uppercase and lowercase letters.

Output  For each test case, if the name is “ABB” style output “Yes”, otherwise output “No” in one line.

Sample Input 4 ZhaoDongDong ChenLiJian XuXuXu ZhaoLi Sample Output Yes No No No --------------------------------------------------------------------------------------------------------------------------------- 这题我重写了四遍......(太菜了我) 题意是判断abb式的名字。


列出思路(参考了@小小小why同学的思路与代码): ZCMU--1516: Name(C语言)_小小小Why的博客-CSDN博客 1.找到首字母所在位置(利用一个数组存储该字母位置) 2.通过首字母位置存储姓氏和名字 3.利用strcmp对字符串进行比较判断是不是abb型的名字 我掉的坑: 1.不是简单把大写字母提取出来判断 2.数组没开够出现了:A Not allowed system call: runid:653257 :使用了系统禁止的 *** 作系统调用,看看是否越权访问了文件或进程等资源 3.对于char数组要对每个单位逐个进行初始化(’\0‘)  4.数组元素尽量一对一进行判断,少利用前后关系(例如a[i]和a[i-1]),这样容易出现边界问题 wa代码①(想问题太简单)

#include

int main()
{
	char a[20];
	char b[3];
	int i,n,j,k=0;
	
	while(scanf("%d",&n)!=EOF)
	{
		for(i=1;i<=n;i++)
		{
			scanf("%s",a);
			
				for(j=0;j='A'&&a[j]<='Z')
					{
						b[k]=a[j];
						k++;
					}
				}
				if(b[0]!=b[1]&&b[1]==b[2])
				printf("Yes\n");
				else
				printf("No\n");
			
		}
	}
	return 0;
}
wa代码②(利用前后关系,样例是对的,但是在“XuXuXu”这个例子上存储出错了)
#include
using namespace std;
int main()
{
	char x[30],y[5];
	char a[10],b[10],c[10];
	int n,i,j;
	cin>>n;
	while(n--)
	{
		memset(a,0,sizeof(a));
		memset(b,0,sizeof(b));
		memset(c,0,sizeof(c));
		memset(x,0,sizeof(x));
		
		cin>>x;
		j=0;
		int flag=0;
		for(i=0;i<=strlen(x);i++)
		{
			if(isupper(x[i]))
			y[j++]=x[i];
		}
		
		for(i=0;i

wa代码③ (对于char数组的初始化需要逐个赋’\0‘ 否则在strcmp会出错)
 
 #include
using namespace std;
int main()
{
	char x[200];
	char a[100],b[100],c[100];
	int po[4];
	int n,i,j;
	cin>>n;
	while(n--)
	{
		 a[10]='\0',b[10]='\0',c[10]='\0';

		memset(po,0,sizeof(po));
		
		cin>>x;
		j=0;
		for(i=0;i<='Z')
			po[j++]=i;	
		}
		j=0;
		for(i=po[0];i='A'&&x[i]

AC代码(参考过@小小小why同学的代码)
 
 #include<100;i++)//逐个进行初始化 
		a[i]='',b[i]='<='Z')
			po[j++]=i;	//利用数组存储大写字母位置 
		}
		j=0;
		for(i=0;i',c[i]='
'; memset(po,0,sizeof(po)); cin> using namespace std; int main() { char x[200]; char a[100],b[100],c[100]; int po[4]; int n,i,j; cin>>n; while(n--) { for(i=0;i

>x; j=0; for(i=1;i

='A'&&x[i]

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/568363.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-09
下一篇 2022-04-09

发表评论

登录后才能评论

评论列表(0条)