字符拆分 邮箱

public class demo14 {
	public static void main(String[] args) {
		String words="长亭外 古道边 芳草碧连天 晚风扶 柳笛声残 夕阳山外山 ";
		String[]printWord=new String[100];
		System.out.println("***原歌词合适***\n"+words);
		System.out.println("\n***拆分后歌词格式***");
		printWord=words.split(" ");
		for(int i=0;i<printWord.length;i++){
			System.out.println(printWord[i]);
		}
	}

}

import java.util.Scanner;


public class demo13 {
	public static void main(String[] args) {
		boolean fileCorrect=false;
		boolean emailCorrect=false;
		System.out.println("---欢迎进入作业提交系统---");
		Scanner input=new Scanner(System.in);
		System.out.println("请输入JAVA文件名:");
		String name=input.next();
		System.out.println("请输入你的邮箱:");
		String email=input.next();
		int index=name.indexOf(".");
		if(index!=-1&&index!=0&&name.substring(index+1,name.length()).equals("java")){
			fileCorrect=true;
		}else{
			System.out.println("文件无效");
		}
		if(email.indexOf('@')!=-1&&email.indexOf('.')>email.indexOf('@')){
			fileCorrect=true;
		}else{
			System.out.println("E-mail无效");
		}
		if(fileCorrect&&emailCorrect){
			System.out.println("作业提交成功!");
			
		}else{
			System.out.println("作业提交失败!");
		}
	}
	

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值