返回列表 發帖

206

import java.util.Scanner;

public class JPD02 {

        public static void main(String[] args) {
                int s=0;
                final String dreams = "There are moments in life when you miss someone so much that "
                                + "you just want to pick them from your dreams and hug them for real! Dream what "
                                + "you want to dream; go where you want to go; be what you want to be, because you have "
                                + "only one life and one chance to do all the things you want to do";

                Scanner sc = new Scanner(System.in);
                String a=sc.next();
                while(dreams==a){
                        s++;
                }
                System.out.print(s);

        }
}

返回列表