2021-05-17

#include <stdio.h>
int main()
{
    int i = 0;
    char s[80] = {""}, max[80] = {""};
    scanf("%s",s);
    strcpy(max,s);
    for(i=1; i<5; i++)
    {
	scanf("%s",s);
	if( strcmp(max,s)<0 )
	    strcpy(max,s);
    }
    printf("%s \n",max);
    return 0;
}

#include <stdio.h>
void fun( char s[],char c)
{
   char *p;
   for(p=s;*p!='\0';p++)
   	{if(*p!=c)
   			*s++=*p;
		   }	
	*s='\0';
}
int main(){
	char str[]="happy new year";
  	char ch;
	printf("happy new year\n");
	scanf("%c",&ch);
	fun(str,ch);
	printf("%s\n",str);
		return 0;
}
#include<stdio.h> 
void strmcpy(char *sp,char *tp,int m)
{
    int j,k; 
    for (j=m-1,k=0; tp[j]!='\0'; j++,k++)
	{
        sp[k]=tp[j];
	}
}
int  main(){ 
          char  st[20],tt[20],ch; 
          int  i=0,m; 
          scanf("%c",&ch); 
        while(ch!='\n'){ 
                tt[i++]=ch; 
                scanf("%c",&ch); 
        } 
        tt[i]='\0'; 
          scanf("%d",&m); 
          strmcpy(st,tt,m); 
          printf("%s\n",st); 
}
#include<stdio.h>
int main(){
    char str[80];
	int i,len,flag;
    flag=0;
    scanf("%s",str);
    len=strlen(str);
    for(i=0;i<len/2;i++)
	{
        if(str[i]==str[len-i-1])
        flag=1;
        else{
            flag=0;
            break;
        }
    }
    if(flag)
        printf("YES\n");
              
    else
         printf("NO\n");                    
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值