9.6 About string,"I am ateacher",这个字符串中有多少个字,且分别把每个字打印出来. public class Test { static intamount_space = 0; //此变量用来记录空格的数量.the variable named amount_space isused to count the number of the space. static intflag_Pro = 0; //此变量用来记录现在处理到大字符串中
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> int main(){ setvbuf(stdout,NULL,_IONBF,0); char s[255]; int a[255]; //存放得到的整数 int i,length; int f(char *s,int *a); printf("Input the string:"); ge
indexOf(String s)的使用,如果包含,返回的值是包含该子字符串在父类字符串中起始位置: 如果不包含必定全部返回值为-1 package my_automation; public class z_test { public static void main(String[] args) { String test = "This is test for string"; System.out.println(test.indexOf("This"));
public class ReserveString { public static void main(String[] args) { System.out.println("Please Input String:"); Scanner sc = new Scanner(System.in); String a = sc.next(); boolean state = false; StringBuffer sb = new StringBuffer(); for (int i
摘自:http://blog.51cto.com/lynnteng0/804520 describe="it's a describe by yourself" if echo "$describe" | grep -q '^[a-zA-Z0-9]\+$'; then echo "ok" else echo "invalid" fi describe="it's a describe by yourself"
Additive number is a string whose digits can form additive sequence. A valid additive sequence should contain at least three numbers. Except for the first two numbers, each subsequent number in the sequence must be the sum of the preceding two. Given