输入一个字符串,找指定的字符是否存在,如果存在,输出yes,

如题所述

第1个回答  2011-05-23
public class Test{
public static void main(String args[]){
String s = args[0];
if(s.contains("t")){
System.out.println("yes");
}
}
}

//这里是测试输入的字符串中是否存在字符t,如果存在则输出yes
第2个回答  2011-05-23
C语言编的,不知道是你想要的吗?
#include<stdio.h>
main()
{int i=0,j;
char c;
char s[80];
scanf("%c,%s",&c,s);
while(s[i]!='\0')
i++;
for(j=0;j<i;j++)
if(s[j]==c)
{printf("yes\n");
break;}
else if(j==i-1)
printf("no\n");
}
第3个回答  2011-05-23
select case when instr(串1,串2)>0 then 'yes' else '' end from dual;追问

需要编写一个完整的程序

本回答被网友采纳
相似回答