Flamer


私信TA

用户名:ding876255970

访问量:46853

签 名:

不怕别人比你优秀,就怕别人比你努力!

等  级
排  名 124
经  验 7522
参赛次数 0
文章发表 49
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:

解题思路:


愉快的心情才能使自己身心投入!

每题笑话:



小芳决定下个星期日结婚,她写信把这件大喜事告诉在外地打工的弟弟。信上这样写着:这个星期日,是我大洗的日子,请回。一个星期后,小芳收到一个大包裹和一封信,是弟弟寄来的。信的内容是:劳动紧张,不能回家,只得将脏衣服寄给你洗。辛苦你了,姐姐!




参考代码:

#include<stdio.h>
#include<string.h>
int main()
{
char a[100];
int i,j;
gets(a);
j=strlen(a);
for(i=0;i<j;i++)
{
if((a[i]>='a'&&a[i]<='y')||(a[i]>='A'&&a[i]<='Y'))
{
printf("%c",a[i]+1);
}
else if(a[i]=='z')
{
printf("a");
}
else if(a[i]=='Z')
{
printf("A");
}
else
{
printf("%c",a[i]);
}
}
return 0;
}

有不懂的可以留言,看在小的这么用心的份上,看客老爷们点个赞吧!

 

0.0分

14 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答

代码解释器

  评论区

#include <stdio.h>
int main()
{
	char s[1000];
	int i=0;
	while ((s[i] = getchar()) != '\n') i++;
	s[i] = '\0';
	for (i = 0; s[i] != '\0'; i++)
	{
		if ((s[i] >= 'a'&&s[i] <= 'z') || (s[i] >= 'A'&&s[i] <= 'Z'))
		{
			if (s[i] == 'z') s[i] = 'a';
			else if (s[i] == 'Z') s[i] = 'A';
			else s[i]++;
		}
	}
	for (i = 0; s[i] != '\0'; i++)
	{
		printf("%c", s[i]);
	}
	printf("\n");
	return 0;
}
请问这个为什么会运行错误?哪位大佬能帮忙看看。
2020-01-22 21:08:06
好冷的笑话
2020-01-15 20:43:29
#include<stdio.h>
int main(){
	char tmp[1000];
	int i;
	gets(tmp);
	for(i=0;tmp[i]!='\0';i++){
		if(tmp[i]>='a' && tmp[i]<='z'){
			if(tmp[i]-97+4+1 >26){
				tmp[i]=(tmp[i]-97+1)%26+97;
			}
			else
				tmp[i]+=1;
		}else if(tmp[i]>='A' && tmp[i]<='Z'){
			if(tmp[i]-65+4+1>26){
				tmp[i]=(tmp[i]-65+1)%26+65;
			}
			else
				tmp[i]+=1;
		}
	}
	printf("%s\n",tmp);
	return 0;
}
2019-09-08 19:23:49
#include <stdio.h>
#include<string.h>

int main()
{
    char test[1024] = {0};
    scanf("%s", test);
	
	int i = 0;
    while(i < strlen(test))
	{
		if((test[i] >= 'a' && test[i] < 'z') || (test[i] >= 'A' && test[i] < 'Z'))
		{
			test[i] += 1;
		}
		
		if(test[i] == 'z')
		{
			test[i] = 'a';
		}
		
		if(test[i] == 'Z')
		{
			test[i] = 'A';
		}

		i++;
	}
	
    printf("%s\n", test);
    return 0;
}
请问这为什么错误???
2019-08-14 17:13:49
#include<stdio.h>
#include<string.h>
int main()
{
    char a[1000];
    gets(a);
    for(int i=0;i<strlen(a);i++)
{
    if((a[i]<'z'&&a[i]>='a')||(a[i]<'Z'&&a[i]>='A'))
    a[i]++;
    else if(a[i]=='z'||a[i]=='Z')
             if(a[i]=='z') a[i]='a';
             else a[i]='A';
}
    printf("%s",a);
    return 0;
}
请问这个为什么会答案错误
2018-11-27 19:58:47
#include<stdio.h>
#include<string.h>
void main()
{
    char a[20],i,t;
    gets(a);
    i=strlen(a);
    for(t=0;t<i;t++)
    {
        if((a[t]>='a'&&a[t]<'z')||(a[t]>='A'&&a[t]<='Z'))
            a[t]=a[t]+1;
        else if(a[t]=='z')
            a[t]='a';
        else if(a[t]=='Z')
            a[t]='Z';
    }
    puts(a);
}
请问这个为什么会运行错误
2017-12-17 16:00:41
  • «
  • 1
  • »